7 |
|
#ifndef _common_h_ |
8 |
|
#define _common_h_ |
9 |
|
|
10 |
+ |
#ifndef __FreeBSD__ |
11 |
+ |
#define _BSD_SOURCE |
12 |
+ |
#define _POSIX_SOURCE |
13 |
+ |
#define _GNU_SOURCE |
14 |
+ |
#endif |
15 |
+ |
|
16 |
|
#include <pwd.h> |
17 |
|
#include <regex.h> |
18 |
|
#include <setjmp.h> |
24 |
|
#include <sys/wait.h> |
25 |
|
#include <unistd.h> |
26 |
|
|
27 |
+ |
#ifndef _PASSWORD_LEN |
28 |
+ |
#define _PASSWORD_LEN BUFSIZ |
29 |
+ |
#endif |
30 |
+ |
|
31 |
+ |
#ifndef MAXLOGNAME |
32 |
+ |
#define MAXLOGNAME 17 |
33 |
+ |
#endif |
34 |
+ |
|
35 |
|
int check(int value, jmp_buf environment); |
36 |
|
int regcheck(int value, const regex_t *regex, jmp_buf environment); |
37 |
|
char *fcheck(char *value, FILE *stream, jmp_buf environment); |
40 |
|
void putpassword(char password[_PASSWORD_LEN], char *name, jmp_buf environment); |
41 |
|
void get(const char *prompt, regex_t *regex, char **string, jmp_buf environment); |
42 |
|
|
43 |
+ |
#ifndef __FreeBSD__ |
44 |
+ |
size_t strlcpy(char *dst, const char *src, size_t size); |
45 |
+ |
size_t strlcat(char *dst, const char *src, size_t size); |
46 |
+ |
char *fgetln(FILE * restrict stream, size_t * restrict len); |
47 |
+ |
#endif |
48 |
+ |
|
49 |
|
#endif//_common_h_ |