1/* 2 * dir.x: Remote directory listing protocol 3 */ 4const MAXNAMELEN = 255; /* maximum length of a directory entry */ 5 6typedef string nametype<MAXNAMELEN>; /* a directory entry */ 7 8typedef struct namenode *namelist; /* a link in the listing */ 9 10/* 11 * A node in the directory listing 12 */ 13struct namenode { 14 nametype name; /* name of directory entry */ 15 namelist next; /* next entry */ 16}; 17 18/* 19 * The result of a READDIR operation. 20 */ 21union readdir_res switch (int errno) { 22case 0: 23 namelist list; /* no error: return directory listing */ 24default: 25 void; /* error occurred: nothing else to return */ 26}; 27 28/* 29 * The directory program definition 30 */ 31program DIRPROG { 32 version DIRVERS { 33 readdir_res 34 READDIR(nametype) = 1; 35 } = 1; 36} = 76; 37