From 34b91a97ee6124765c0ee3a01771833ee6f8989a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 10 Nov 2013 18:20:16 -0600 Subject: Break out lib/pending.h from lib/lib.h. --- lib/pending.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/pending.h (limited to 'lib/pending.h') diff --git a/lib/pending.h b/lib/pending.h new file mode 100644 index 00000000..335ca522 --- /dev/null +++ b/lib/pending.h @@ -0,0 +1,32 @@ +// pending.h - header for pending.c + +// Unfortunately, sizeof() doesn't work in a preprocessor test. TODO. + +//#if sizeof(double) <= sizeof(long) +//typedef double FLOAT; +//#else +typedef float FLOAT; +//#endif + +// libc generally has this, but the headers are screwed up +ssize_t getline(char **lineptr, size_t *n, FILE *stream); + +void names_to_pid(char **names, int (*callback)(pid_t pid, char *name)); + +// password.c +#define MAX_SALT_LEN 20 //3 for id, 16 for key, 1 for '\0' +#define SYS_FIRST_ID 100 +#define SYS_LAST_ID 999 +int get_salt(char *salt, char * algo); +void is_valid_username(const char *name); +int read_password(char * buff, int buflen, char* mesg); +int update_password(char *filename, char* username, char* encrypted); + +// cut helper functions +unsigned long get_int_value(const char *numstr, unsigned long lowrange, unsigned long highrange); + +// grep helper functions +char *astrcat (char *, char *); +char *xastrcat (char *, char *); + +void daemonize(void); -- cgit v1.2.3