aboutsummaryrefslogtreecommitdiff
path: root/lib/pending.h
blob: fbd72c467d3fba9d3f289db24c6c85b7ce9f2415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// 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);
char *human_readable(unsigned long long size);