Skip to content

Commit

Permalink
perf tools: Unexport some methods unused outside strbuf.c
Browse files Browse the repository at this point in the history
Cc: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Mar 23, 2016
1 parent 88fd633 commit 0741208
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 8 additions & 1 deletion tools/perf/util/strbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,21 @@ void strbuf_grow(struct strbuf *sb, size_t extra)
ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc);
}

void strbuf_addch(struct strbuf *sb, int c)
{
strbuf_grow(sb, 1);
sb->buf[sb->len++] = c;
sb->buf[sb->len] = '\0';
}

void strbuf_add(struct strbuf *sb, const void *data, size_t len)
{
strbuf_grow(sb, len);
memcpy(sb->buf + sb->len, data, len);
strbuf_setlen(sb, sb->len + len);
}

void strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
static void strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
{
int len;
va_list ap_saved;
Expand Down
7 changes: 1 addition & 6 deletions tools/perf/util/strbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ static inline void strbuf_setlen(struct strbuf *sb, size_t len) {
}

/*----- add data in your buffer -----*/
static inline void strbuf_addch(struct strbuf *sb, int c) {
strbuf_grow(sb, 1);
sb->buf[sb->len++] = c;
sb->buf[sb->len] = '\0';
}
void strbuf_addch(struct strbuf *sb, int c);

void strbuf_add(struct strbuf *buf, const void *, size_t);
static inline void strbuf_addstr(struct strbuf *sb, const char *s) {
Expand All @@ -84,7 +80,6 @@ static inline void strbuf_addstr(struct strbuf *sb, const char *s) {

__attribute__((format(printf,2,3)))
void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
void strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap);

/* XXX: if read fails, any partial read is undone */
ssize_t strbuf_read(struct strbuf *, int fd, ssize_t hint);
Expand Down

0 comments on commit 0741208

Please sign in to comment.