X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv.git;a=blobdiff_plain;f=lib.h;h=7d78cb9856e1354d4f8e43e57bb167d6079a9953;hp=8a9c3482b39ad7d78c8b64982dd4a1c190d456dd;hb=d237116707105a3ca6cf367a672bc5263cf7856d;hpb=703b99b834625829d6b285e5bca619475ef54511 diff --git a/lib.h b/lib.h index 8a9c348..7d78cb9 100644 --- a/lib.h +++ b/lib.h @@ -2,7 +2,7 @@ * userv - lib.c * useful utility routines' imports and exports, used in daemon * - * Copyright (C)1996-1997 Ian Jackson + * Copyright (C)1996-1997,1999 Ian Jackson * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -22,16 +22,16 @@ #ifndef LIB_H #define LIB_H -char *xmstrcat3save(const char *a, const char *b, const char *c); -char *xmstrsave(const char *s); -char *xmstrsubsave(const char *begin, int len); +char *xstrcat3save(const char *a, const char *b, const char *c); +char *xstrsave(const char *s); +char *xstrsubsave(const char *begin, int len); void miscerror(const char *what) NONRETURNING; void syscallerror(const char *what) NONRETURNING; void *xmalloc(size_t s); void *xrealloc(void *p, size_t s); -char *xstrdup(const char *str); -void makeroom(char **buffer, int *size, int needed); +int makeroom(char **buffer, int *size, int needed); +/* makeroom returns -1 if needed was far too large; otherwise returns 0. */ /* It doesn't appear to be documented whether [v]snprintf put a null * in if they overrun. GNU libc does, but I don't want to rely on @@ -56,4 +56,8 @@ void vsnytprintfcat(char *buffer, size_t size, const char *fmt, va_list al); void snytprintfcat(char *buffer, size_t size, const char *fmt, ...) PRINTFFORMAT(3,4); void strnytcat(char *dest, const char *src, size_t size); +#ifndef HAVE_SETENV +int setenv(const char *name, const char *value, int overwrite); +#endif /* HAVE_SETENV */ + #endif /* LIB_H */