fns.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. ulong FPcontrol(ulong,ulong);
  2. ulong FPstatus(ulong,ulong);
  3. void FPsave(void*);
  4. void FPrestore(void*);
  5. void Sleep(Rendez*, int (*)(void*), void*);
  6. int Wakeup(Rendez*);
  7. void FPinit(void);
  8. void addprog(Proc*);
  9. Block* adjustblock(Block*, int);
  10. Block* allocb(int);
  11. Block* bl2mem(uchar*, Block*, int);
  12. int blocklen(Block*);
  13. char* c2name(Chan*);
  14. int canlock(Lock*);
  15. int canqlock(QLock*);
  16. void cclose(Chan*);
  17. void chandevinit(void);
  18. void chanfree(Chan*);
  19. Dir* chandirstat(Chan*);
  20. void cinit(void);
  21. char* clipread(void);
  22. int clipwrite(char*);
  23. void (*coherence)(void);
  24. void copen(Chan*);
  25. void cmderror(Cmdbuf*, char*);
  26. Block* concatblock(Block*);
  27. int cread(Chan*, uchar*, int, vlong);
  28. void cwrite(Chan*, uchar*, int, vlong);
  29. Chan* cunique(Chan*);
  30. void cupdate(Chan*, uchar*, int, vlong);
  31. char* cleanname(char*);
  32. Chan* cclone(Chan*);
  33. void closeegrp(Egrp*);
  34. void closefgrp(Fgrp*);
  35. void closepgrp(Pgrp*);
  36. void closesigs(Skeyset*);
  37. int cmount(Chan*, Chan*, int, char*);
  38. Chan* createdir(Chan*, Mhead*);
  39. void cunmount(Chan*, Chan*);
  40. int decref(Ref*);
  41. long devbwrite(Chan*, Block*, ulong);
  42. void devcreate(Chan*, char*, int, ulong);
  43. void devdir(Chan*, Qid, char*, long, char*, long, Dir*);
  44. long devdirread(Chan*, char*, long, Dirtab*, int, Devgen*);
  45. void devinit(void);
  46. int devno(int, int);
  47. Dev* devbyname(char*);
  48. void devpermcheck(char*, ulong, int);
  49. void devremove(Chan*);
  50. int devstat(Chan*, uchar*, int, Dirtab*, int, Devgen*);
  51. long devtabread(Chan*, void*, long, vlong);
  52. int devwstat(Chan*, uchar*, int);
  53. Chan* devattach(int, char*);
  54. Block* devbread(Chan*, long, ulong);
  55. Chan* devclone(Chan*);
  56. Devgen devgen;
  57. Chan* devopen(Chan*, int, Dirtab*, int, Devgen*);
  58. Walkqid* devwalk(Chan*, Chan*, char**, int, Dirtab*, int, Devgen*);
  59. void disfault(void*, char*);
  60. void disinit(void*);
  61. int domount(Chan**, Mhead**);
  62. void drawqlock(void);
  63. void drawqunlock(void);
  64. Fgrp* dupfgrp(Fgrp*);
  65. void egrpcpy(Egrp*, Egrp*);
  66. int emptystr(char*);
  67. void emuinit(void*);
  68. int eqchan(Chan*, Chan*, int);
  69. int eqqid(Qid, Qid);
  70. void error(char*);
  71. void errorf(char*, ...);
  72. #pragma varargck argpos errorf 1
  73. void excinit(void);
  74. void exhausted(char*);
  75. int export(int, char*, int);
  76. Chan* fdtochan(Fgrp*, int, int, int, int);
  77. int findmount(Chan**, Mhead**, int, int, Qid);
  78. void freeb(Block*);
  79. void freeblist(Block*);
  80. void freeskey(Signerkey*);
  81. ulong getcallerpc(void*);
  82. ulong getFPcontrol(void);
  83. ulong getFPstatus(void);
  84. void gkbdputc(Queue*, int);
  85. int incref(Ref*);
  86. int iprint(char*, ...);
  87. void isdir(Chan*);
  88. int isdotdot(char*);
  89. int iseve(void);
  90. int kannounce(char*, char*);
  91. int kdial(char*, char*, char*, int*);
  92. void kproc(char*, void (*)(void*), void*, int);
  93. void kprocinit(Proc*);
  94. int kfgrpclose(Fgrp*, int);
  95. void ksetenv(char*, char*, int);
  96. void kstrcpy(char*, char*, int);
  97. void kstrdup(char**, char*);
  98. long latin1(uchar*, int);
  99. void libinit(char*);
  100. void links(void);
  101. void lock(Lock*);
  102. Cmdtab* lookupcmd(Cmdbuf*, Cmdtab*, int);
  103. Block* mem2bl(uchar*, int);
  104. int memusehigh(void);
  105. int memlow(void);
  106. void mkqid(Qid*, vlong, ulong, int);
  107. Qid mkuqid(Chan*, Uqid*);
  108. Chan* mntauth(Chan*, char*);
  109. long mntversion(Chan*, char*, int, int);
  110. void mountfree(Mount*);
  111. void mousetrack(int, int, int, int);
  112. void muxclose(Mnt*);
  113. Chan* namec(char*, int, int, ulong);
  114. Chan* newchan(void);
  115. Cname* newcname(char*);
  116. Egrp* newegrp(void);
  117. Fgrp* newfgrp(Fgrp*);
  118. Mount* newmount(Mhead*, Chan*, int, char*);
  119. Pgrp* newpgrp(void);
  120. Proc* newproc(void);
  121. void nexterror(void);
  122. void nofence(void);
  123. void notkilled(void);
  124. int openmode(ulong);
  125. void osblock(void);
  126. void* oscmd(char**, int, char*, int*);
  127. int oscmdwait(void*, char*, int);
  128. int oscmdkill(void*);
  129. void oscmdfree(void*);
  130. void oserror(void);
  131. void oserrstr(char*, uint);
  132. void oslongjmp(void*, osjmpbuf, int);
  133. long osmillisec(void);
  134. int osmillisleep(ulong);
  135. void osready(Proc*);
  136. int limbosleep(ulong);
  137. vlong osusectime(void);
  138. Block* packblock(Block*);
  139. Block* padblock(Block*, int);
  140. void panic(char*, ...);
  141. Cmdbuf* parsecmd(char*, int);
  142. void pexit(char*, int);
  143. void pgrpcpy(Pgrp*, Pgrp*);
  144. int progfdprint(Chan*, int, int, char*, int);
  145. void putenvq(char*, char*, int);
  146. void putenvqv(char*, char**, int, int);
  147. void putmhead(Mhead*);
  148. Block* pullupblock(Block*, int);
  149. Block* pullupqueue(Queue*, int);
  150. void qaddlist(Queue*, Block*);
  151. Block* qbread(Queue*, int);
  152. long qbwrite(Queue*, Block*);
  153. Queue* qbypass(void (*)(void*, Block*), void*);
  154. int qcanread(Queue*);
  155. void qclose(Queue*);
  156. int qisclosed(Queue*);
  157. int qconsume(Queue*, void*, int);
  158. Block* qcopy(Queue*, int, ulong);
  159. int qdiscard(Queue*, int);
  160. void qflush(Queue*);
  161. void qfree(Queue*);
  162. int qfull(Queue*);
  163. Block* qget(Queue*);
  164. void qhangup(Queue*, char*);
  165. int qiwrite(Queue*, void*, int);
  166. int qlen(Queue*);
  167. void qlock(QLock*);
  168. void qnoblock(Queue*, int);
  169. Queue* qopen(int, int, void (*)(void*), void*);
  170. int qpass(Queue*, Block*);
  171. int qproduce(Queue*, void*, int);
  172. void qputback(Queue*, Block*);
  173. long qread(Queue*, void*, int);
  174. Block* qremove(Queue*);
  175. void qreopen(Queue*);
  176. void qsetlimit(Queue*, int);
  177. int qstate(Queue*);
  178. void qunlock(QLock*);
  179. int qwindow(Queue*);
  180. int qwrite(Queue*, void*, int);
  181. ulong randomread(void *xp, ulong n);
  182. void randominit(void);
  183. int readkbd(void);
  184. int readnum(ulong, char*, ulong, ulong, int);
  185. int readnum_vlong(ulong, char*, ulong, vlong, int);
  186. int readstr(ulong, char*, ulong, char*);
  187. #define seconds() (osusectime()/1000000)
  188. void seterror(char*, ...);
  189. void setid(char*, int);
  190. void setpointer(int, int);
  191. char* skipslash(char*);
  192. void srvrtinit(void);
  193. void swiproc(Proc*, int);
  194. Block* trimblock(Block*, int, int);
  195. long unionread(Chan*, void*, long);
  196. void unlock(Lock*);
  197. Uqid* uqidalloc(Uqidtab*, Chan*);
  198. void uqidinit(Uqidtab*);
  199. void freeuqid(Uqidtab*, Uqid*);
  200. void validname(char*, int);
  201. void validstat(uchar*, int);
  202. void validwstatname(char*);
  203. void vmachine(void*);
  204. int walk(Chan**, char**, int, int, int*);
  205. void cleanexit(int);
  206. void oshostintr(Proc*);
  207. void osenter(void);
  208. void osleave(void);
  209. void oslopri(void);
  210. void ospause(void);
  211. void osyield(void);
  212. void osreboot(char*, char**);
  213. ulong poolmaxsize(void);
  214. Pool* poolmk(char*, int, int, int);
  215. void hnputv(void*, vlong);
  216. void hnputl(void*, ulong);
  217. void hnputs(void*, ushort);
  218. vlong nhgetv(void*);
  219. ulong nhgetl(void*);
  220. ushort nhgets(void*);
  221. void* smalloc(size_t);
  222. void* kmalloc(size_t);
  223. /* Namespace Emulation */
  224. int kbind(char*, char*, int);
  225. int kclose(int);
  226. int kcreate(char*, int, ulong);
  227. int kdup(int, int);
  228. int kfstat(int, uchar*, int);
  229. int kfwstat(int, uchar*, int);
  230. int kmount(int, int, char*, int, char*);
  231. int kunmount(char*, char*);
  232. int kopen(char*, int);
  233. long kread(int, void*, long);
  234. int kremove(char*);
  235. vlong kseek(int, vlong, int);
  236. int kstat(char*, uchar*, int);
  237. long kwrite(int, void*, long);
  238. int kwstat(char*, uchar*, int);
  239. Dir* kdirstat(char*);
  240. Dir* kdirfstat(int);
  241. int kdirwstat(char*, Dir*);
  242. int kdirfwstat(int, Dir*);
  243. long kdirread(int, Dir**);
  244. int klisten(char*, char*);
  245. Cname* addelem(Cname*, char*);
  246. void cleancname(Cname*);
  247. void cnameclose(Cname*);
  248. #pragma varargck argpos iprint 1