all.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #include "u.h"
  2. #include "lib.h"
  3. #include "dat.h"
  4. #include "fns.h"
  5. #define CHAT(cp) ((cons.flags&chatflag)||(cp&&(((Chan*)cp)->flags&chatflag)))
  6. #define QID9P1(a,b) (Qid9p1){(a),(b)}
  7. #define QPDIR 0x80000000L
  8. #define QPNONE 0
  9. #define QPROOT 1
  10. #define QPSUPER 2
  11. /*
  12. * perm argument in 9P create
  13. */
  14. #define PDIR (1L<<31) /* is a directory */
  15. #define PAPND (1L<<30) /* is append only */
  16. #define PLOCK (1L<<29) /* is locked on open */
  17. #define FID1 1
  18. #define FID2 2
  19. #define SECOND(n) (n)
  20. #define MINUTE(n) (n*SECOND(60))
  21. #define HOUR(n) (n*MINUTE(60))
  22. #define DAY(n) (n*HOUR(24))
  23. #define MAXBIAS SECOND(20)
  24. #define TLOCK MINUTE(5)
  25. #define NQUEUE 20
  26. Uid* uid;
  27. Userid* gidspace;
  28. Lock printing;
  29. Time tim;
  30. File* files;
  31. Wpath* wpaths;
  32. Lock wpathlock;
  33. char* errstr9p[MAXERR];
  34. Chan* chans;
  35. RWlock mainlock;
  36. Timet mktime;
  37. Timet boottime;
  38. Queue* serveq;
  39. Queue* raheadq;
  40. Rabuf* rabuffree;
  41. QLock reflock;
  42. Lock rabuflock;
  43. Tlock tlocks[NTLOCK];
  44. Lock tlocklock;
  45. Device* devnone;
  46. Startsb startsb[5];
  47. int predawn; /* set in early boot, causes polling ttyout */
  48. int mballocs[MAXCAT];
  49. Filsys filsys[10]; /* named file systems -- from config block */
  50. char service[50]; /* my name -- from config block */
  51. int aindex;
  52. ulong roflag;
  53. ulong errorflag;
  54. ulong chatflag;
  55. ulong attachflag;
  56. ulong authdebugflag;
  57. ulong authdisableflag;
  58. int noattach;
  59. int echo;
  60. int wstatallow; /* set to circumvent wstat permissions */
  61. int writeallow; /* set to circumvent write permissions */
  62. int duallow; /* single user to allow du */
  63. int readonly; /* disable writes if true */
  64. int noauth; /* Debug */
  65. int rawreadok; /* allow reading raw data */
  66. File* flist[5003]; /* base of file structures */
  67. Lock flock; /* manipulate flist */
  68. long growacct[1000];
  69. struct
  70. {
  71. RWlock uidlock;
  72. Iobuf* uidbuf;
  73. int flen;
  74. int find;
  75. } uidgc;
  76. extern char statecall[];
  77. extern char* wormscode[];
  78. extern char* tagnames[];