Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.1.3
Fetching contributors…

Cannot retrieve contributors at this time

115 lines (87 sloc) 2.775 kb
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <alpm_list.h>
#include "error.h"
#include "powaur.h"
#include "environment.h"
#include "wrapper.h"
int powaur_backup(alpm_list_t *targets);
extern int (*pw_printf)(enum pwloglevel_t lvl, const char *fmt, ...)
__attribute__((format (printf, 2, 3)));
extern int (*pw_fprintf)(enum pwloglevel_t lvl, FILE *stream, const char *fmt, ...)
__attribute__((format (printf, 3, 4)));
extern int (*pw_vfprintf)(enum pwloglevel_t lvl, FILE *stream, const char *fmt, va_list ap)
__attribute__((format (printf, 3, 0)));
/* Setup color printing functions */
void color_print_setup(void);
/* Restore color printing functions to non-colorized versions */
void color_print_restore(void);
int extract_file(const char *filename);
int getcols(void);
char *strtrim(char *line);
int wait_or_whine(pid_t pid, char *argv0);
/* Prints c for rep times */
void print_repeat(char c, int rep);
void indent_print(enum pwloglevel_t lvl, alpm_list_t *list, size_t indent);
void print_list(alpm_list_t *list, const char *prefix);
void print_list_break(alpm_list_t *list, const char *prefix);
void print_list_deps(alpm_list_t *list, const char *prefix);
void print_pkginfo(alpm_list_t *list);
int yesno(const char *fmt, ...);
int mcq(const char *qn, const char *array, int arraySize, int preset);
char *have_dotinstall(void);
alpm_list_t *list_diff(alpm_list_t *left, alpm_list_t *right,
alpm_list_fn_cmp cmpfn);
alpm_list_t *list_intersect(alpm_list_t *left, alpm_list_t *right,
alpm_list_fn_cmp cmpfn);
/* Prints the color of a repo */
void color_repo(const char *repo);
/* Prints groups in color */
void color_groups(alpm_list_t *grp);
#define MINI_BUFSZ 60
#define ASSERT(somecond, someact) do {\
if (!(somecond)) {\
} while (0)
#define PW_SETERRNO(errnum) do {\
pwerrno = errnum;\
pw_fprintf(PW_LOG_ERROR, stderr, "%s: %s\n", __func__, pw_strerrorlast());\
} while (0)
#define CLEAR_ERRNO() do {\
pwerrno = PW_ERR_OK;\
} while (0)
#define RET_ERR(errnum, retval) do {\
pwerrno = errnum;\
pw_printf(PW_LOG_ERROR, "%s: %s\n", __func__, pw_strerror(errnum));\
return retval;\
} while (0)
#define RET_ERR_VOID(errnum) do {\
pwerrno = errnum;\
} while (0)
#define CALLOC(myptr, nmemb, mysz, act) do {\
myptr = xcalloc(nmemb, mysz);\
if (!myptr) {\
} while (0)
#define MALLOC(myptr, mysz, act) do {\
myptr = malloc(mysz);\
if (!myptr) {\
} while (0)
#define STRDUP(mydest, myorig, act) do {\
mydest = strdup(myorig);\
if (!mydest) {\
} while(0)
#define FREE(myptr) if (myptr) { free(myptr); }
#define FCLOSE(myfp) if (myfp) { fclose(myfp); myfp = NULL; }
Jump to Line
Something went wrong with that request. Please try again.