ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/CCSAdmin/common.h
(Generate patch)

Comparing CCSAdmin/common.h (file contents):
Revision 572 by douglas, 2005-09-25T17:43:17-07:00 vs.
Revision 807 by douglas, 2006-06-29T07:39:29-07:00

# Line 7 | Line 7
7   #ifndef _common_h_
8   #define _common_h_
9  
10 < #ifndef __FreeBSD__
10 > #ifdef linux
11 > #undef linux
12 > #endif
13 >
14 > #if !defined(__FreeBSD__) && !defined(__sun__) && !defined(__APPLE__)
15 > #ifndef _BSD_SOURCE
16   #define _BSD_SOURCE
17 + #endif
18 + #ifndef _POSIX_SOURCE
19   #define _POSIX_SOURCE
20 + #endif
21 + #ifndef _GNU_SOURCE
22   #define _GNU_SOURCE
23   #endif
24 + #elif defined(__sun__)
25 + #define __EXTENSIONS__
26 + #endif
27  
28   #include <pwd.h>
29   #include <regex.h>
# Line 32 | Line 44
44   #define MAXLOGNAME 17
45   #endif
46  
47 + typedef struct
48 + {
49 +        const char *name;
50 +        char *freebsd, *linux, *darwin, *solaris;
51 + }
52 + Shells;
53 +
54 + typedef enum { sh, csh, tcsh, bash, ksh, zsh, _3sh, custom } Shell;
55 +
56 + extern Shells shells[];
57 +
58   int check(int value, jmp_buf environment);
59   int regcheck(int value, const regex_t *regex, jmp_buf environment);
60   char *fcheck(char *value, FILE *stream, jmp_buf environment);
# Line 39 | Line 62 | void authenticate(const char *program, j
62   void getpassword(char password[_PASSWORD_LEN], jmp_buf environment);
63   void putpassword(char password[_PASSWORD_LEN], char *name, jmp_buf environment);
64   void get(const char *prompt, regex_t *regex, char **string, jmp_buf environment);
65 + void setshells(Shells *shells, jmp_buf environment);
66  
67 < #ifndef __FreeBSD__
67 > #if !defined(__FreeBSD__) && !defined(__sun__) && !defined(__APPLE__)
68   size_t strlcpy(char *dst, const char *src, size_t size);
69   size_t strlcat(char *dst, const char *src, size_t size);
70   char *fgetln(FILE * restrict stream, size_t * restrict len);
71 + #elif defined(__sun__)
72 + char *fgetln(FILE * restrict stream, size_t * restrict len);
73 + int setenv(const char *name, const char *value, int overwrite);
74   #endif
75  
76   #endif//_common_h_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines