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