all.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #include <u.h>
  2. #include <libc.h>
  3. #include <ctype.h>
  4. #define Tfile Tfilescsi /* avoid name conflict */
  5. #include <disk.h>
  6. #undef Tfile
  7. #include <bio.h>
  8. #include <ip.h>
  9. #include "dat.h"
  10. #include "portfns.h"
  11. #define malloc(n) ialloc(n, 0)
  12. #define CHAT(cp) ((cons.flags&chatflag) || \
  13. ((cp) && (((Chan*)(cp))->flags&chatflag)))
  14. #define QID9P1(a,b) (Qid9p1){a,b}
  15. #define SECOND(n) (n)
  16. #define MINUTE(n) ((n)*SECOND(60))
  17. #define HOUR(n) ((n)*MINUTE(60))
  18. #define DAY(n) ((n)*HOUR(24))
  19. enum {
  20. QPDIR = 0x80000000L,
  21. QPNONE = 0,
  22. QPROOT = 1,
  23. QPSUPER = 2,
  24. /*
  25. * perm argument in 9P create
  26. */
  27. PDIR = 1L<<31, /* is a directory */
  28. PAPND = 1L<<30, /* is append only */
  29. PLOCK = 1L<<29, /* is locked on open */
  30. FID1 = 1,
  31. FID2 = 2,
  32. MAXBIAS = SECOND(20),
  33. TLOCK = MINUTE(5),
  34. };
  35. Uid* uid;
  36. short* gidspace;
  37. Lock printing;
  38. Time tim;
  39. File* files;
  40. Wpath* wpaths;
  41. Lock wpathlock;
  42. char* errstr9p[MAXERR];
  43. Chan* chans;
  44. RWLock mainlock;
  45. Timet fs_mktime;
  46. Timet boottime;
  47. Queue* serveq;
  48. Queue* raheadq;
  49. Rabuf* rabuffree;
  50. QLock reflock;
  51. Lock rabuflock;
  52. Tlock tlocks[NTLOCK];
  53. Lock tlocklock;
  54. Device* devnone;
  55. Startsb startsb[5];
  56. int mballocs[MAXCAT];
  57. /* from config block */
  58. char service[50]; /* my name */
  59. Filsys filsys[30]; /* named file systems */
  60. /*
  61. * these are only documentation, but putting them in the config block makes
  62. * them visible. the real values are compiled into cwfs.
  63. */
  64. typedef struct Fspar Fspar;
  65. struct Fspar {
  66. char* name;
  67. long actual; /* compiled-in value */
  68. long declared;
  69. } fspar[];
  70. ulong roflag;
  71. ulong errorflag;
  72. ulong chatflag;
  73. ulong attachflag;
  74. ulong authdebugflag;
  75. ulong authdisableflag;
  76. int noattach;
  77. int wstatallow; /* set to circumvent wstat permissions */
  78. int writeallow; /* set to circumvent write permissions */
  79. int duallow; /* single user to allow du */
  80. int readonly; /* disable writes if true */
  81. int noauth; /* Debug */
  82. int rawreadok; /* allow reading raw data */
  83. File* flist[5003]; /* base of file structures */
  84. Lock flock; /* manipulate flist */
  85. long growacct[1000];
  86. struct
  87. {
  88. RWLock uidlock;
  89. Iobuf* uidbuf;
  90. int flen;
  91. int find;
  92. } uidgc;
  93. extern char statecall[];
  94. extern char* wormscode[];
  95. extern char* tagnames[];