git/usage.c

/*
 * GIT - The information manager from hell
 *
 * Copyright (C) Linus Torvalds, 2005
 */
#include "git-compat-util.h"
#include "gettext.h"
#include "trace2.h"

static void vreportf(const char *prefix, const char *err, va_list params)
{}

static NORETURN void usage_builtin(const char *err, va_list params)
{}

static void die_message_builtin(const char *err, va_list params)
{}

/*
 * We call trace2_cmd_error_va() in the below functions first and
 * expect it to va_copy 'params' before using it (because an 'ap' can
 * only be walked once).
 */
static NORETURN void die_builtin(const char *err, va_list params)
{}

static void error_builtin(const char *err, va_list params)
{}

static void warn_builtin(const char *warn, va_list params)
{}

static int die_is_recursing_builtin(void)
{}

/* If we are in a dlopen()ed .so write to a global variable would segfault
 * (ugh), so keep things static. */
static NORETURN_PTR report_fn usage_routine =;
static NORETURN_PTR report_fn die_routine =;
static report_fn die_message_routine =;
static report_fn error_routine =;
static report_fn warn_routine =;
static int (*die_is_recursing)(void) =;

void set_die_routine(NORETURN_PTR report_fn routine)
{}

report_fn get_die_message_routine(void)
{}

void set_error_routine(report_fn routine)
{}

report_fn get_error_routine(void)
{}

void set_warn_routine(report_fn routine)
{}

report_fn get_warn_routine(void)
{}

void set_die_is_recursing_routine(int (*routine)(void))
{}

void NORETURN usagef(const char *err, ...)
{}

void NORETURN usage(const char *err)
{}

void NORETURN die(const char *err, ...)
{}

static const char *fmt_with_err(char *buf, int n, const char *fmt)
{}

void NORETURN die_errno(const char *fmt, ...)
{}

#undef die_message
int die_message(const char *err, ...)
{}

#undef die_message_errno
int die_message_errno(const char *fmt, ...)
{}

#undef error_errno
int error_errno(const char *fmt, ...)
{}

#undef error
int error(const char *err, ...)
{}

void warning_errno(const char *warn, ...)
{}

void warning(const char *warn, ...)
{}

/* Only set this, ever, from t/helper/, when verifying that bugs are caught. */
int BUG_exit_code;

static void BUG_vfl_common(const char *file, int line, const char *fmt,
			   va_list params)
{}

static NORETURN void BUG_vfl(const char *file, int line, const char *fmt, va_list params)
{}

NORETURN void BUG_fl(const char *file, int line, const char *fmt, ...)
{}

int bug_called_must_BUG;
void bug_fl(const char *file, int line, const char *fmt, ...)
{}

#ifdef SUPPRESS_ANNOTATED_LEAKS
void unleak_memory(const void *ptr, size_t len)
{
	static struct suppressed_leak_root {
		struct suppressed_leak_root *next;
		char data[FLEX_ARRAY];
	} *suppressed_leaks;
	struct suppressed_leak_root *root;

	FLEX_ALLOC_MEM(root, data, ptr, len);
	root->next = suppressed_leaks;
	suppressed_leaks = root;
}
#endif