mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
aurblup: mark all functions and global variables static
These don't need visibility outside of this compilation unit. This also allows a C compiler to inline and optimize as it sees fit. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
0cb493ef2a
commit
59c82af185
1 changed files with 23 additions and 23 deletions
|
@ -14,17 +14,17 @@
|
||||||
#define alpm_die(...) die(__VA_ARGS__, alpm_strerrorlast());
|
#define alpm_die(...) die(__VA_ARGS__, alpm_strerrorlast());
|
||||||
#define mysql_die(...) die(__VA_ARGS__, mysql_error(c));
|
#define mysql_die(...) die(__VA_ARGS__, mysql_error(c));
|
||||||
|
|
||||||
void die(const char *, ...);
|
static void die(const char *, ...);
|
||||||
alpm_list_t *pkglist_append(alpm_list_t *, const char *);
|
static alpm_list_t *pkglist_append(alpm_list_t *, const char *);
|
||||||
alpm_list_t *blacklist_get_pkglist();
|
static alpm_list_t *blacklist_get_pkglist();
|
||||||
void blacklist_add(const char *);
|
static void blacklist_add(const char *);
|
||||||
void blacklist_remove(const char *);
|
static void blacklist_remove(const char *);
|
||||||
void blacklist_sync(alpm_list_t *, alpm_list_t *);
|
static void blacklist_sync(alpm_list_t *, alpm_list_t *);
|
||||||
alpm_list_t *dblist_get_pkglist(alpm_list_t *);
|
static alpm_list_t *dblist_get_pkglist(alpm_list_t *);
|
||||||
alpm_list_t *dblist_create(void);
|
static alpm_list_t *dblist_create(void);
|
||||||
void read_config(const char *);
|
static void read_config(const char *);
|
||||||
void init(void);
|
static void init(void);
|
||||||
void cleanup(void);
|
static void cleanup(void);
|
||||||
|
|
||||||
static char *mysql_host = NULL;
|
static char *mysql_host = NULL;
|
||||||
static char *mysql_socket = NULL;
|
static char *mysql_socket = NULL;
|
||||||
|
@ -32,9 +32,9 @@ static char *mysql_user = NULL;
|
||||||
static char *mysql_passwd = NULL;
|
static char *mysql_passwd = NULL;
|
||||||
static char *mysql_db = NULL;
|
static char *mysql_db = NULL;
|
||||||
|
|
||||||
MYSQL *c;
|
static MYSQL *c;
|
||||||
|
|
||||||
void
|
static void
|
||||||
die(const char *format, ...)
|
die(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
|
@ -48,7 +48,7 @@ die(const char *format, ...)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_list_t *
|
static alpm_list_t *
|
||||||
pkglist_append(alpm_list_t *pkglist, const char *pkgname)
|
pkglist_append(alpm_list_t *pkglist, const char *pkgname)
|
||||||
{
|
{
|
||||||
int len = strcspn(pkgname, "<=>");
|
int len = strcspn(pkgname, "<=>");
|
||||||
|
@ -67,7 +67,7 @@ pkglist_append(alpm_list_t *pkglist, const char *pkgname)
|
||||||
return pkglist;
|
return pkglist;
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_list_t *
|
static alpm_list_t *
|
||||||
blacklist_get_pkglist()
|
blacklist_get_pkglist()
|
||||||
{
|
{
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
|
@ -88,7 +88,7 @@ blacklist_get_pkglist()
|
||||||
return pkglist;
|
return pkglist;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
blacklist_add(const char *name)
|
blacklist_add(const char *name)
|
||||||
{
|
{
|
||||||
char *esc = malloc(strlen(name) * 2 + 1);
|
char *esc = malloc(strlen(name) * 2 + 1);
|
||||||
|
@ -103,7 +103,7 @@ blacklist_add(const char *name)
|
||||||
mysql_die("failed to query MySQL database (\"%s\"): %s\n", query);
|
mysql_die("failed to query MySQL database (\"%s\"): %s\n", query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
blacklist_remove(const char *name)
|
blacklist_remove(const char *name)
|
||||||
{
|
{
|
||||||
char *esc = malloc(strlen(name) * 2 + 1);
|
char *esc = malloc(strlen(name) * 2 + 1);
|
||||||
|
@ -117,7 +117,7 @@ blacklist_remove(const char *name)
|
||||||
mysql_die("failed to query MySQL database (\"%s\"): %s\n", query);
|
mysql_die("failed to query MySQL database (\"%s\"): %s\n", query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
blacklist_sync(alpm_list_t *pkgs_cur, alpm_list_t *pkgs_new)
|
blacklist_sync(alpm_list_t *pkgs_cur, alpm_list_t *pkgs_new)
|
||||||
{
|
{
|
||||||
alpm_list_t *pkgs_add, *pkgs_rem, *p;
|
alpm_list_t *pkgs_add, *pkgs_rem, *p;
|
||||||
|
@ -141,7 +141,7 @@ blacklist_sync(alpm_list_t *pkgs_cur, alpm_list_t *pkgs_new)
|
||||||
alpm_list_free(pkgs_rem);
|
alpm_list_free(pkgs_rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_list_t *
|
static alpm_list_t *
|
||||||
dblist_get_pkglist(alpm_list_t *dblist)
|
dblist_get_pkglist(alpm_list_t *dblist)
|
||||||
{
|
{
|
||||||
alpm_list_t *d, *p, *q;
|
alpm_list_t *d, *p, *q;
|
||||||
|
@ -173,7 +173,7 @@ dblist_get_pkglist(alpm_list_t *dblist)
|
||||||
return pkglist;
|
return pkglist;
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_list_t *
|
static alpm_list_t *
|
||||||
dblist_create(void)
|
dblist_create(void)
|
||||||
{
|
{
|
||||||
alpm_list_t *d;
|
alpm_list_t *d;
|
||||||
|
@ -201,7 +201,7 @@ dblist_create(void)
|
||||||
return dblist;
|
return dblist;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
read_config(const char *fn)
|
read_config(const char *fn)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -258,7 +258,7 @@ read_config(const char *fn)
|
||||||
die("MySQL database setting not found in AUR config file\n");
|
die("MySQL database setting not found in AUR config file\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
init(void)
|
init(void)
|
||||||
{
|
{
|
||||||
if (mysql_library_init(0, NULL, NULL))
|
if (mysql_library_init(0, NULL, NULL))
|
||||||
|
@ -277,7 +277,7 @@ init(void)
|
||||||
alpm_die("failed to set ALPM database path: %s\n");
|
alpm_die("failed to set ALPM database path: %s\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
cleanup(void)
|
cleanup(void)
|
||||||
{
|
{
|
||||||
if (mysql_host) free(mysql_host);
|
if (mysql_host) free(mysql_host);
|
||||||
|
|
Loading…
Add table
Reference in a new issue