git/strbuf.c

#include "git-compat-util.h"
#include "gettext.h"
#include "hex-ll.h"
#include "strbuf.h"
#include "string-list.h"
#include "utf8.h"
#include "date.h"

int starts_with(const char *str, const char *prefix)
{}

int istarts_with(const char *str, const char *prefix)
{}

int starts_with_mem(const char *str, size_t len, const char *prefix)
{}

int skip_to_optional_arg_default(const char *str, const char *prefix,
				 const char **arg, const char *def)
{}

/*
 * Used as the default ->buf value, so that people can always assume
 * buf is non NULL and ->buf is NUL terminated even for a freshly
 * initialized strbuf.
 */
char strbuf_slopbuf[1];

void strbuf_init(struct strbuf *sb, size_t hint)
{}

void strbuf_release(struct strbuf *sb)
{}

char *strbuf_detach(struct strbuf *sb, size_t *sz)
{}

void strbuf_attach(struct strbuf *sb, void *buf, size_t len, size_t alloc)
{}

void strbuf_grow(struct strbuf *sb, size_t extra)
{}

void strbuf_trim(struct strbuf *sb)
{}

void strbuf_rtrim(struct strbuf *sb)
{}

void strbuf_trim_trailing_dir_sep(struct strbuf *sb)
{}

void strbuf_trim_trailing_newline(struct strbuf *sb)
{}

void strbuf_ltrim(struct strbuf *sb)
{}

int strbuf_reencode(struct strbuf *sb, const char *from, const char *to)
{}

void strbuf_tolower(struct strbuf *sb)
{}

struct strbuf **strbuf_split_buf(const char *str, size_t slen,
				 int terminator, int max)
{}

void strbuf_add_separated_string_list(struct strbuf *str,
				      const char *sep,
				      struct string_list *slist)
{}

void strbuf_list_free(struct strbuf **sbs)
{}

int strbuf_cmp(const struct strbuf *a, const struct strbuf *b)
{}

void strbuf_splice(struct strbuf *sb, size_t pos, size_t len,
				   const void *data, size_t dlen)
{}

void strbuf_insert(struct strbuf *sb, size_t pos, const void *data, size_t len)
{}

void strbuf_vinsertf(struct strbuf *sb, size_t pos, const char *fmt, va_list ap)
{}

void strbuf_insertf(struct strbuf *sb, size_t pos, const char *fmt, ...)
{}

void strbuf_remove(struct strbuf *sb, size_t pos, size_t len)
{}

void strbuf_add(struct strbuf *sb, const void *data, size_t len)
{}

void strbuf_addstrings(struct strbuf *sb, const char *s, size_t n)
{}

void strbuf_addbuf(struct strbuf *sb, const struct strbuf *sb2)
{}

const char *strbuf_join_argv(struct strbuf *buf,
			     int argc, const char **argv, char delim)
{}

void strbuf_addchars(struct strbuf *sb, int c, size_t n)
{}

void strbuf_addf(struct strbuf *sb, const char *fmt, ...)
{}

static void add_lines(struct strbuf *out,
			const char *prefix,
			const char *buf, size_t size,
			int space_after_prefix)
{}

void strbuf_add_commented_lines(struct strbuf *out, const char *buf,
				size_t size, const char *comment_prefix)
{}

void strbuf_commented_addf(struct strbuf *sb, const char *comment_prefix,
			   const char *fmt, ...)
{}

void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
{}

int strbuf_expand_step(struct strbuf *sb, const char **formatp)
{}

size_t strbuf_expand_literal(struct strbuf *sb, const char *placeholder)
{}

void strbuf_expand_bad_format(const char *format, const char *command)
{}

void strbuf_addbuf_percentquote(struct strbuf *dst, const struct strbuf *src)
{}

#define URL_UNSAFE_CHARS

void strbuf_add_percentencode(struct strbuf *dst, const char *src, int flags)
{}

size_t strbuf_fread(struct strbuf *sb, size_t size, FILE *f)
{}

ssize_t strbuf_read(struct strbuf *sb, int fd, size_t hint)
{}

ssize_t strbuf_read_once(struct strbuf *sb, int fd, size_t hint)
{}

ssize_t strbuf_write(struct strbuf *sb, FILE *f)
{}

#define STRBUF_MAXLINK

int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
{}

int strbuf_getcwd(struct strbuf *sb)
{}

#ifdef HAVE_GETDELIM
int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)
{}
#else
int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)
{
	int ch;

	if (feof(fp))
		return EOF;

	strbuf_reset(sb);
	flockfile(fp);
	while ((ch = getc_unlocked(fp)) != EOF) {
		if (!strbuf_avail(sb))
			strbuf_grow(sb, 1);
		sb->buf[sb->len++] = ch;
		if (ch == term)
			break;
	}
	funlockfile(fp);
	if (ch == EOF && sb->len == 0)
		return EOF;

	sb->buf[sb->len] = '\0';
	return 0;
}
#endif

int strbuf_appendwholeline(struct strbuf *sb, FILE *fp, int term)
{}

static int strbuf_getdelim(struct strbuf *sb, FILE *fp, int term)
{}

int strbuf_getdelim_strip_crlf(struct strbuf *sb, FILE *fp, int term)
{}

int strbuf_getline(struct strbuf *sb, FILE *fp)
{}

int strbuf_getline_lf(struct strbuf *sb, FILE *fp)
{}

int strbuf_getline_nul(struct strbuf *sb, FILE *fp)
{}

int strbuf_getwholeline_fd(struct strbuf *sb, int fd, int term)
{}

ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint)
{}

void strbuf_add_lines(struct strbuf *out, const char *prefix,
		      const char *buf, size_t size)
{}

void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
{}

static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
				 char_predicate allow_unencoded_fn)
{}

void strbuf_addstr_urlencode(struct strbuf *sb, const char *s,
			     char_predicate allow_unencoded_fn)
{}

static void strbuf_humanise(struct strbuf *buf, off_t bytes,
				 int humanise_rate)
{}

void strbuf_humanise_bytes(struct strbuf *buf, off_t bytes)
{}

void strbuf_humanise_rate(struct strbuf *buf, off_t bytes)
{}

int printf_ln(const char *fmt, ...)
{}

int fprintf_ln(FILE *fp, const char *fmt, ...)
{}

char *xstrdup_tolower(const char *string)
{}

char *xstrdup_toupper(const char *string)
{}

char *xstrvfmt(const char *fmt, va_list ap)
{}

char *xstrfmt(const char *fmt, ...)
{}

void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm,
		     int tz_offset, int suppress_tz_name)
{}

/*
 * Returns the length of a line, without trailing spaces.
 *
 * If the line ends with newline, it will be removed too.
 */
static size_t cleanup(char *line, size_t len)
{}

/*
 * Remove empty lines from the beginning and end
 * and also trailing spaces from every line.
 *
 * Turn multiple consecutive empty lines between paragraphs
 * into just one empty line.
 *
 * If the input has only empty lines and spaces,
 * no output will be produced.
 *
 * If last line does not have a newline at the end, one is added.
 *
 * Pass a non-NULL comment_prefix to skip every line starting
 * with it.
 */
void strbuf_stripspace(struct strbuf *sb, const char *comment_prefix)
{}

void strbuf_strip_file_from_path(struct strbuf *sb)
{}