X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fmkpasswd%2Futils.h;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fmkpasswd%2Futils.h;h=0f226aee2f3f6ba8d15fcf37eab36543e56ad9e4;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/mkpasswd/utils.h b/cirros-testvm/src-cirros/buildroot-2015.05/package/mkpasswd/utils.h new file mode 100644 index 0000000..0f226ae --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/mkpasswd/utils.h @@ -0,0 +1,56 @@ +#ifndef WHOIS_UTILS_H +#define WHOIS_UTILS_H + +/* Convenience macros */ +#define streq(a, b) (strcmp(a, b) == 0) +#define strcaseeq(a, b) (strcasecmp(a, b) == 0) +#define strneq(a, b, n) (strncmp(a, b, n) == 0) +#define strncaseeq(a, b, n) (strncasecmp(a, b, n) == 0) + +#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__) + +/* Portability macros */ +#ifdef __GNUC__ +# define NORETURN __attribute__((noreturn)) +#else +# define NORETURN +#endif + +#ifndef AI_IDN +# define AI_IDN 0 +#endif + +#ifndef AI_ADDRCONFIG +# define AI_ADDRCONFIG 0 +#endif + +#ifdef HAVE_GETOPT_LONG +# define GETOPT_LONGISH(c, v, o, l, i) getopt_long(c, v, o, l, i) +#else +# define GETOPT_LONGISH(c, v, o, l, i) getopt(c, v, o) +#endif + +#ifdef ENABLE_NLS +# include +# include +# define _(a) (gettext(a)) +# ifdef gettext_noop +# define N_(a) gettext_noop(a) +# else +# define N_(a) (a) +# endif +#else +# define _(a) (a) +# define N_(a) (a) +# define ngettext(a, b, c) ((c==1) ? (a) : (b)) +#endif + + +/* Prototypes */ +void *do_nofail(void *ptr, const char *file, const int line); +char **merge_args(char *args, char *argv[], int *argc); + +void err_quit(const char *fmt, ...) NORETURN; +void err_sys(const char *fmt, ...) NORETURN; + +#endif