static FILE *_gr_fp;
static struct group _gr_group;
static int _gr_stayopen;
-static int grscan(), start_gr();
+static int grscan __P((int, gid_t, const char *));
+static int start_gr __P((void));
#define MAXGRP 200
static char *members[MAXGRP];
static int
grscan(search, gid, name)
- register int search, gid;
- register char *name;
+ register int search;
+ register gid_t gid;
+ register const char *name;
{
register char *cp, **m;
char *bp;
int
getgrouplist(uname, agroup, groups, grpcnt)
const char *uname;
- int agroup;
- register int *groups;
+ gid_t agroup;
+ register gid_t *groups;
int *grpcnt;
{
register struct group *grp;
int
initgroups(uname, agroup)
const char *uname;
- int agroup;
+ gid_t agroup;
{
- int groups[NGROUPS], ngroups;
+ gid_t groups[NGROUPS];
+ int ngroups;
ngroups = NGROUPS;
if (getgrouplist(uname, agroup, groups, &ngroups) < 0)
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
+#include <unistd.h>
#ifdef SETMODE_DEBUG
#include <stdio.h>
#define CMD2_UBITS 0x10
static BITCMD *addcmd __P((BITCMD *, int, int, int, u_int));
-static int compress_mode __P((BITCMD *));
+static void compress_mode __P((BITCMD *));
#ifdef SETMODE_DEBUG
static void dumpmode __P((BITCMD *));
#endif
* bits) followed by a '+' (set bits).
*/
mode_t
+#if __STDC__
+getmode(const void *bbox, mode_t omode)
+#else
getmode(bbox, omode)
- void *bbox;
+ const void *bbox;
mode_t omode;
+#endif
{
register BITCMD *set;
register mode_t clrval, newmode, value;
void *
setmode(p)
- register char *p;
+ register const char *p;
{
register int perm, who;
register char op;
set->cmd2 = ((who & S_IRUSR) ? CMD2_UBITS : 0) |
((who & S_IRGRP) ? CMD2_GBITS : 0) |
((who & S_IROTH) ? CMD2_OBITS : 0);
- set->bits = ~0;
+ set->bits = (mode_t)~0;
} else {
set->cmd2 = CMD2_UBITS | CMD2_GBITS | CMD2_OBITS;
set->bits = mask;
* 'g' and 'o' commands continue to be separate. They could probably be
* compacted, but it's not worth the effort.
*/
-static int
+static void
compress_mode(set)
register BITCMD *set;
{
* unvis - decode characters previously encoded by vis
*/
int
+#if __STDC__
+unvis(char *cp, char c, int *astate, int flag)
+#else
unvis(cp, c, astate, flag)
char *cp;
char c;
int *astate, flag;
+#endif
{
if (flag & UNVIS_END) {