1 /*$Id: misc.h,v 1.56 2001/06/30 01:14:19 guenther Exp $*/
2 
3 struct dyna_array{int filled,tspace;char*vals;};
4 union offori{off_t o;int i;};
5 
6 #define app_val_type(sp,t,s,v)	(*(t*)app_val_(&sp,sizeof(s))=(v))
7 #define app_valo(sp,val)	app_val_type(sp,off_t,union offori,val)
8 #define app_vali(sp,val)	app_val_type(sp,int,union offori,val)
9 
10 #define app_vall(sp,val)	app_val_type(sp,long,long,val)
11 #define app_valp(sp,val)	app_val_type(sp,const char*,const char*,val)
12 
13 #define acc_val_(sp,t,s,off)	(*(t*)&(((s*)sp.vals)[off]))
14 
15 /* these are lvalues */
16 
17 #define acc_valo(sp,off)	acc_val_(sp,off_t,union offori,off)
18 #define acc_vali(sp,off)	acc_val_(sp,int,union offori,off)
19 #define acc_vall(sp,off)	acc_val_(sp,long,long,off)
20 #define acc_valp(sp,off)	acc_val_(sp,const char*,const char*,off)
21 
22 struct dynstring{struct dynstring*enext;char ename[255];};
23 
24 void
25  elog P((const char*const newt)),
26  ignoreterm P((void)),
27  shutdesc P((void)),
28  checkroot P((const int c,const unsigned long Xid)),
29  setids P((void)),
30  writeerr P((const char*const line)),
31  progerr P((const char*const line,int xitcode,int okay)),
32  chderr P((const char*const dir)),
33  readerr P((const char*const file)),
34  verboff P((void)),
35  verbon P((void)),
36  newid P((void)),
37  zombiecollect P((void)),
38  yell P((const char*const a,const char*const b)),
39  nlog P((const char*const a)),
40  logqnl P((const char*const a)),
41  skipped P((const char*const x)),
42  onguard P((void)),
43  offguard P((void)),
44  Terminate P((void)) __attribute__((noreturn)),
45  suspend P((void)),
46  *app_val_ P((struct dyna_array*const sp,int size)),
47  setupsigs P((void));
48 int
49  forkerr Q((const pid_t pid,const char*const a)),
50  buildpath P((const char*name,const char*const path,const char*const file)),
51  nextrcfile P((void)),
52  enoughprivs Q((const auth_identity*const passinvk,const uid_t euid,
53   const gid_t egid,const uid_t uid,const gid_t gid)),
54  conditions P((char flags[],const int prevcond,const int lastsucc,
55   const int lastcond,const int skipping,int nrcond));
56 char
57  *tstrdup P((const char*const a)),
58  *cstr P((char*const a,const char*const b)),
59  *egrepin P((char*expr,const char*source,const long len,int casesens));
60 const char
61  *newdynstring P((struct dynstring**const adrp,const char*const chp));
62 
63 extern int fakedelivery;
64