1 | /* |
---|
2 | * |
---|
3 | * Copyright (C) 1988, 1989 by the Massachusetts Institute of Technology |
---|
4 | * Developed by the MIT Student Information Processing Board (SIPB). |
---|
5 | * For copying information, see the file mit-copyright.h in this release. |
---|
6 | * |
---|
7 | */ |
---|
8 | /* |
---|
9 | * |
---|
10 | * $Source: /afs/dev.mit.edu/source/repository/athena/bin/discuss/libds/stubs.c,v $ |
---|
11 | * $Header: /afs/dev.mit.edu/source/repository/athena/bin/discuss/libds/stubs.c,v 1.14 1989-06-03 00:21:54 srz Exp $ |
---|
12 | * |
---|
13 | * stubs.c -- These are stubs that handle the calling of routines. |
---|
14 | * |
---|
15 | * $Log: not supported by cvs2svn $ |
---|
16 | * Revision 1.13 89/03/27 00:33:07 srz |
---|
17 | * Null out fields, so that callers can FREE() fields of trn_info & mtg_info |
---|
18 | * after calling. |
---|
19 | * |
---|
20 | * Revision 1.12 89/01/29 17:17:59 srz |
---|
21 | * Added flag routines, and version check. |
---|
22 | * |
---|
23 | * Revision 1.11 89/01/04 20:52:00 raeburn |
---|
24 | * Still fixing includes.. |
---|
25 | * |
---|
26 | * Revision 1.10 88/10/16 14:04:50 raeburn |
---|
27 | * Changed includes and type names. |
---|
28 | * |
---|
29 | * Revision 1.9 87/10/06 02:36:45 spook |
---|
30 | * Fixed error detected by High C compiler. |
---|
31 | * |
---|
32 | * Revision 1.8 87/07/20 20:57:47 srz |
---|
33 | * Changed name of whoami to dwhoami (too generic of a name) |
---|
34 | * |
---|
35 | * Revision 1.7 87/07/08 02:00:16 wesommer |
---|
36 | * Added whoami(), dsc_whoami() (the server support was always there. |
---|
37 | * |
---|
38 | * Revision 1.6 87/06/27 01:10:55 spook |
---|
39 | * *** empty log message *** |
---|
40 | * |
---|
41 | * Revision 1.5 87/04/11 00:06:13 srz |
---|
42 | * Added RCS junk |
---|
43 | * |
---|
44 | * |
---|
45 | */ |
---|
46 | #ifndef lint |
---|
47 | static char rcsid_stubs_c[] = |
---|
48 | "$Header: /afs/dev.mit.edu/source/repository/athena/bin/discuss/libds/stubs.c,v 1.14 1989-06-03 00:21:54 srz Exp $"; |
---|
49 | #endif lint |
---|
50 | |
---|
51 | /* Derived from CORE.PAS 06/21/86 by SRZ */ |
---|
52 | |
---|
53 | #include <discuss/interface.h> |
---|
54 | #include "rpc.h" |
---|
55 | #include <discuss/tfile.h> |
---|
56 | #include <discuss/acl.h> |
---|
57 | |
---|
58 | extern bool recvbool(); |
---|
59 | extern char *recvstr(); |
---|
60 | dsc_acl *recv_acl(); |
---|
61 | |
---|
62 | static char discuss[] = "discuss"; |
---|
63 | |
---|
64 | /* |
---|
65 | * |
---|
66 | * add_trn () -- |
---|
67 | * adds a transaction to the current meeting, either as a reply or an |
---|
68 | * original transaction. Returns an error code, and the transaction number |
---|
69 | * given to the transaction |
---|
70 | * |
---|
71 | */ |
---|
72 | add_trn (mtg_name, source_file, subject, reply_trn, result_trn, result) |
---|
73 | char *mtg_name; |
---|
74 | tfile source_file; |
---|
75 | char *subject; |
---|
76 | trn_nums reply_trn; /* trn replying to; 0 if original */ |
---|
77 | trn_nums *result_trn; /* trn number given to added trn */ |
---|
78 | int *result; |
---|
79 | { |
---|
80 | startsend(ADD_TRN); |
---|
81 | if (rpc_err) { *result = rpc_err; return; } |
---|
82 | sendstr(mtg_name); |
---|
83 | sendfile(source_file); |
---|
84 | sendstr(subject); |
---|
85 | sendint(reply_trn); |
---|
86 | sendit(discuss); |
---|
87 | senddata(source_file); |
---|
88 | if (rpc_err) { *result = rpc_err; return; } |
---|
89 | recvreply (); |
---|
90 | if (rpc_err) { *result = rpc_err; return; } |
---|
91 | *result_trn = recvint(); |
---|
92 | *result = recvint(); |
---|
93 | if (rpc_err) { *result = rpc_err; return; } |
---|
94 | return; |
---|
95 | } |
---|
96 | |
---|
97 | /* |
---|
98 | * |
---|
99 | * get_trn_info () -- |
---|
100 | * returns information about the given transaction in info, with an error |
---|
101 | * code as its return argument |
---|
102 | * |
---|
103 | */ |
---|
104 | get_trn_info (mtg_name, trn, info, result) |
---|
105 | char *mtg_name; |
---|
106 | trn_nums trn; |
---|
107 | trn_info *info; |
---|
108 | int *result; |
---|
109 | { |
---|
110 | info -> subject = NULL; /* Not allocated */ |
---|
111 | info -> author = NULL; |
---|
112 | startsend(GET_TRN_INFO); |
---|
113 | if (rpc_err) { *result = rpc_err; return; } |
---|
114 | sendstr(mtg_name); |
---|
115 | sendint(trn); |
---|
116 | sendit(discuss); |
---|
117 | if (rpc_err) { *result = rpc_err; return; } |
---|
118 | recvreply(); |
---|
119 | if (rpc_err) { *result = rpc_err; return; } |
---|
120 | recv_trn_info(info); |
---|
121 | *result = recvint(); |
---|
122 | if (rpc_err) { *result = rpc_err; return; } |
---|
123 | return; |
---|
124 | } |
---|
125 | |
---|
126 | /* |
---|
127 | * |
---|
128 | * get_trn_info2 () -- |
---|
129 | * returns information about the given transaction in info, with an error |
---|
130 | * code as its return argument |
---|
131 | * |
---|
132 | */ |
---|
133 | get_trn_info2 (mtg_name, trn, info, result) |
---|
134 | char *mtg_name; |
---|
135 | trn_nums trn; |
---|
136 | trn_info2 *info; |
---|
137 | int *result; |
---|
138 | { |
---|
139 | info -> subject = NULL; /* Not allocated */ |
---|
140 | info -> author = NULL; |
---|
141 | startsend(GET_TRN_INFO2); |
---|
142 | if (rpc_err) { *result = rpc_err; return; } |
---|
143 | sendstr(mtg_name); |
---|
144 | sendint(trn); |
---|
145 | sendit(discuss); |
---|
146 | if (rpc_err) { *result = rpc_err; return; } |
---|
147 | recvreply(); |
---|
148 | if (rpc_err) { *result = rpc_err; return; } |
---|
149 | recv_trn_info2(info); |
---|
150 | *result = recvint(); |
---|
151 | if (rpc_err) { *result = rpc_err; return; } |
---|
152 | return; |
---|
153 | } |
---|
154 | |
---|
155 | |
---|
156 | /* |
---|
157 | * |
---|
158 | * delete_trn () -- |
---|
159 | * deletes the given transaction from the current meeting. Returns an |
---|
160 | * error code |
---|
161 | * |
---|
162 | */ |
---|
163 | delete_trn (mtg_name, trn, result) |
---|
164 | char *mtg_name; |
---|
165 | trn_nums trn; |
---|
166 | int *result; |
---|
167 | { |
---|
168 | startsend(DELETE_TRN); |
---|
169 | if (rpc_err) { *result = rpc_err; return; } |
---|
170 | sendstr(mtg_name); |
---|
171 | sendint(trn); |
---|
172 | sendit(discuss); |
---|
173 | if (rpc_err) { *result = rpc_err; return; } |
---|
174 | recvreply(); |
---|
175 | if (rpc_err) { *result = rpc_err; return; } |
---|
176 | *result = recvint(); |
---|
177 | if (rpc_err) { *result = rpc_err; return; } |
---|
178 | return; |
---|
179 | } |
---|
180 | |
---|
181 | /* |
---|
182 | * |
---|
183 | * retrieve_trn () -- |
---|
184 | * retrieves a previously deleted transaction from the current meeting, if |
---|
185 | * possible. trn must refer to a deleted transaction. An error code is |
---|
186 | * returned |
---|
187 | * |
---|
188 | */ |
---|
189 | retrieve_trn (mtg_name, trn, result) |
---|
190 | char *mtg_name; |
---|
191 | trn_nums trn; |
---|
192 | int *result; |
---|
193 | { |
---|
194 | startsend(RETRIEVE_TRN); |
---|
195 | if (rpc_err) { *result = rpc_err; return; } |
---|
196 | sendstr (mtg_name); |
---|
197 | sendint (trn); |
---|
198 | sendit(discuss); |
---|
199 | if (rpc_err) { *result = rpc_err; return; } |
---|
200 | recvreply(); |
---|
201 | if (rpc_err) { *result = rpc_err; return; } |
---|
202 | *result = recvint(); |
---|
203 | if (rpc_err) { *result = rpc_err; return; } |
---|
204 | return; |
---|
205 | } |
---|
206 | |
---|
207 | |
---|
208 | |
---|
209 | /* |
---|
210 | * |
---|
211 | * create_mtg () -- |
---|
212 | * Creates a new meeting with the given long_mtg name, where location is the |
---|
213 | * it's place in the hierarchy, and the long_mtg_name is its canonical name. |
---|
214 | * The chairman of the new meeting is the current user. |
---|
215 | * |
---|
216 | */ |
---|
217 | create_mtg (location, long_mtg_name, public, result) |
---|
218 | char *location,*long_mtg_name; |
---|
219 | bool public; |
---|
220 | int *result; |
---|
221 | { |
---|
222 | startsend(CREATE_MTG); |
---|
223 | if (rpc_err) { *result = rpc_err; return; } |
---|
224 | sendstr(location); |
---|
225 | sendstr(long_mtg_name); |
---|
226 | sendbool(public); |
---|
227 | sendit(discuss); |
---|
228 | if (rpc_err) { *result = rpc_err; return; } |
---|
229 | recvreply(); |
---|
230 | if (rpc_err) { *result = rpc_err; return; } |
---|
231 | *result = recvint(); |
---|
232 | if (rpc_err) { *result = rpc_err; return; } |
---|
233 | return; |
---|
234 | } |
---|
235 | |
---|
236 | |
---|
237 | /* |
---|
238 | * |
---|
239 | * old_get_mtg_info () -- |
---|
240 | * returns information about the given meeting. Return argument is an |
---|
241 | * error code |
---|
242 | * |
---|
243 | */ |
---|
244 | old_get_mtg_info (mtg_name, info, result) |
---|
245 | char *mtg_name; |
---|
246 | mtg_info *info; |
---|
247 | int *result; |
---|
248 | { |
---|
249 | info -> location = NULL; |
---|
250 | info -> long_name = NULL; |
---|
251 | info -> chairman = NULL; |
---|
252 | startsend(OLD_GET_MTG_INFO); |
---|
253 | if (rpc_err) { *result = rpc_err; return; } |
---|
254 | sendstr(mtg_name); |
---|
255 | sendit(discuss); |
---|
256 | if (rpc_err) { *result = rpc_err; return; } |
---|
257 | recvreply(); |
---|
258 | if (rpc_err) { *result = rpc_err; return; } |
---|
259 | old_recv_mtg_info(info); |
---|
260 | *result = recvint(); |
---|
261 | if (rpc_err) { *result = rpc_err; return; } |
---|
262 | return; |
---|
263 | } |
---|
264 | /* |
---|
265 | * |
---|
266 | * get_mtg_info () -- |
---|
267 | * returns information about the given meeting. Return argument is an |
---|
268 | * error code |
---|
269 | * |
---|
270 | */ |
---|
271 | get_mtg_info (mtg_name, info, result) |
---|
272 | char *mtg_name; |
---|
273 | mtg_info *info; |
---|
274 | int *result; |
---|
275 | { |
---|
276 | info -> location = NULL; |
---|
277 | info -> long_name = NULL; |
---|
278 | info -> chairman = NULL; |
---|
279 | info -> access_modes = NULL; |
---|
280 | startsend(GET_MTG_INFO); |
---|
281 | if (rpc_err) { *result = rpc_err; return; } |
---|
282 | sendstr(mtg_name); |
---|
283 | sendit(discuss); |
---|
284 | if (rpc_err) { *result = rpc_err; return; } |
---|
285 | recvreply(); |
---|
286 | if (rpc_err) { *result = rpc_err; return; } |
---|
287 | recv_mtg_info(info); |
---|
288 | *result = recvint(); |
---|
289 | if (rpc_err) { *result = rpc_err; return; } |
---|
290 | return; |
---|
291 | } |
---|
292 | |
---|
293 | /* |
---|
294 | * |
---|
295 | * get_trn () -- |
---|
296 | * gets the given transaction, and feeds it through dest_file. Returns an |
---|
297 | * error code |
---|
298 | * |
---|
299 | */ |
---|
300 | get_trn (mtg_name, trn, dest_file, result) |
---|
301 | char *mtg_name; |
---|
302 | trn_nums trn; |
---|
303 | tfile dest_file; |
---|
304 | int *result; |
---|
305 | { |
---|
306 | startsend(GET_TRN); |
---|
307 | if (rpc_err) { *result = rpc_err; return; } |
---|
308 | sendstr(mtg_name); |
---|
309 | sendint(trn); |
---|
310 | sendfile(dest_file); |
---|
311 | sendit(discuss); |
---|
312 | if (rpc_err) { *result = rpc_err; return; } |
---|
313 | recvdata(dest_file); |
---|
314 | recvreply(); |
---|
315 | if (rpc_err) { *result = rpc_err; return; } |
---|
316 | *result = recvint(); |
---|
317 | if (rpc_err) { *result = rpc_err; return; } |
---|
318 | return; |
---|
319 | } |
---|
320 | |
---|
321 | /* |
---|
322 | * |
---|
323 | * remove_mtg () -- |
---|
324 | * removes the given meeting from the meeting list. This should |
---|
325 | * probably go ahead and physically remove the contents of the meeting |
---|
326 | * but that's not obvious if we have the access to do that. |
---|
327 | * |
---|
328 | */ |
---|
329 | remove_mtg (mtg_name, result) |
---|
330 | char *mtg_name; |
---|
331 | int *result; |
---|
332 | { |
---|
333 | startsend(REMOVE_MTG); |
---|
334 | if (rpc_err) { *result = rpc_err; return; } |
---|
335 | sendstr(mtg_name); |
---|
336 | sendit(discuss); |
---|
337 | if (rpc_err) { *result = rpc_err; return; } |
---|
338 | recvreply(); |
---|
339 | if (rpc_err) { *result = rpc_err; return; } |
---|
340 | *result = recvint(); |
---|
341 | if (rpc_err) { *result = rpc_err; return; } |
---|
342 | return; |
---|
343 | } |
---|
344 | /* |
---|
345 | * |
---|
346 | * updated_mtg () -- Quick procedure to check if the meeting is updated |
---|
347 | * with respect to a given time and transaction number. |
---|
348 | * |
---|
349 | */ |
---|
350 | updated_mtg (mtg_name, date_attended, last, updated, result) |
---|
351 | char *mtg_name; |
---|
352 | int date_attended, last; |
---|
353 | bool *updated; |
---|
354 | int *result; |
---|
355 | { |
---|
356 | startsend(UPDATED_MTG); |
---|
357 | if (rpc_err) { *result = rpc_err; return; } |
---|
358 | sendstr(mtg_name); |
---|
359 | sendint(date_attended); |
---|
360 | sendint(last); |
---|
361 | sendit(discuss); |
---|
362 | if (rpc_err) { *result = rpc_err; return; } |
---|
363 | recvreply(); |
---|
364 | if (rpc_err) { *result = rpc_err; return; } |
---|
365 | *updated = recvbool(); |
---|
366 | *result = recvint(); |
---|
367 | if (rpc_err) { *result = rpc_err; return; } |
---|
368 | return; |
---|
369 | } |
---|
370 | #define rpccheck if (rpc_err) { *result = rpc_err; return; } |
---|
371 | /* |
---|
372 | * get_acl () -- Get access control list. |
---|
373 | */ |
---|
374 | get_acl(mtg_name, result, list) |
---|
375 | char *mtg_name; |
---|
376 | int *result; /* RETURN */ |
---|
377 | dsc_acl **list; /* RETURN */ |
---|
378 | { |
---|
379 | startsend(GET_ACL); |
---|
380 | rpccheck; |
---|
381 | sendstr(mtg_name); |
---|
382 | sendit(discuss); |
---|
383 | rpccheck; |
---|
384 | recvreply(); |
---|
385 | if (rpc_err) { *result = rpc_err; return; } |
---|
386 | *result = recvint(); |
---|
387 | *list = recv_acl(); |
---|
388 | rpccheck; |
---|
389 | return; |
---|
390 | } |
---|
391 | |
---|
392 | get_access(mtg_name, princ_name, modes, result) |
---|
393 | char *mtg_name; |
---|
394 | char *princ_name; |
---|
395 | char **modes; /* RETURN */ |
---|
396 | int *result; /* RETURN */ |
---|
397 | { |
---|
398 | *modes = NULL; |
---|
399 | startsend(GET_ACCESS); |
---|
400 | rpccheck; |
---|
401 | sendstr(mtg_name); |
---|
402 | sendstr(princ_name); |
---|
403 | sendit(discuss); |
---|
404 | rpccheck; |
---|
405 | recvreply(); |
---|
406 | if (rpc_err) { *result = rpc_err; return; } |
---|
407 | *modes = recvstr(); |
---|
408 | *result = recvint(); |
---|
409 | rpccheck; |
---|
410 | return; |
---|
411 | } |
---|
412 | set_access(mtg_name, princ_name, modes, result) |
---|
413 | char *mtg_name; |
---|
414 | char *princ_name; |
---|
415 | char *modes; |
---|
416 | int *result; /* RETURN */ |
---|
417 | { |
---|
418 | startsend(SET_ACCESS); |
---|
419 | rpccheck; |
---|
420 | sendstr(mtg_name); |
---|
421 | sendstr(princ_name); |
---|
422 | sendstr(modes); |
---|
423 | sendit(discuss); |
---|
424 | rpccheck; |
---|
425 | recvreply(); |
---|
426 | if (rpc_err) { *result = rpc_err; return; } |
---|
427 | *result = recvint(); |
---|
428 | rpccheck; |
---|
429 | return; |
---|
430 | } |
---|
431 | |
---|
432 | delete_access(mtg_name, princ_name, result) |
---|
433 | char *mtg_name; |
---|
434 | char *princ_name; |
---|
435 | int *result; /* RETURN */ |
---|
436 | { |
---|
437 | startsend(DELETE_ACCESS); |
---|
438 | rpccheck; |
---|
439 | sendstr(mtg_name); |
---|
440 | sendstr(princ_name); |
---|
441 | sendit(discuss); |
---|
442 | rpccheck; |
---|
443 | recvreply(); |
---|
444 | if (rpc_err) { *result = rpc_err; return; } |
---|
445 | *result = recvint(); |
---|
446 | rpccheck; |
---|
447 | return; |
---|
448 | } |
---|
449 | |
---|
450 | set_trn_flags(mtg_name, trn, flags, result) |
---|
451 | char *mtg_name; |
---|
452 | trn_nums trn; |
---|
453 | int flags; |
---|
454 | int *result; |
---|
455 | { |
---|
456 | startsend(SET_TRN_FLAGS); |
---|
457 | if (rpc_err) { *result = rpc_err; return; } |
---|
458 | sendstr(mtg_name); |
---|
459 | sendint(trn); |
---|
460 | sendint(flags); |
---|
461 | sendit(discuss); |
---|
462 | if (rpc_err) { *result = rpc_err; return; } |
---|
463 | recvreply(); |
---|
464 | if (rpc_err) { *result = rpc_err; return; } |
---|
465 | *result = recvint(); |
---|
466 | if (rpc_err) { *result = rpc_err; return; } |
---|
467 | return; |
---|
468 | } |
---|
469 | |
---|
470 | |
---|
471 | dwhoami(ident, result) |
---|
472 | char **ident; |
---|
473 | int *result; |
---|
474 | { |
---|
475 | *result = 0; |
---|
476 | *ident = NULL; |
---|
477 | startsend(WHO_AM_I); |
---|
478 | rpccheck; |
---|
479 | sendit(discuss); |
---|
480 | rpccheck; |
---|
481 | recvreply(); |
---|
482 | if (rpc_err) { *result = rpc_err; return; } |
---|
483 | *ident = recvstr(); |
---|
484 | rpccheck; |
---|
485 | return; |
---|
486 | } |
---|
487 | |
---|
488 | get_server_version() |
---|
489 | { |
---|
490 | int vers_num,result; |
---|
491 | |
---|
492 | startsend(GET_SERVER_VERSION); |
---|
493 | if (rpc_err) return (SERVER_0); |
---|
494 | sendit(discuss); |
---|
495 | if (rpc_err) return (SERVER_0); |
---|
496 | recvreply(); |
---|
497 | if (rpc_err) return (SERVER_0); |
---|
498 | vers_num = recvint(); |
---|
499 | if (rpc_err) return (SERVER_0); |
---|
500 | result = recvint(); |
---|
501 | if (rpc_err) return (SERVER_0); |
---|
502 | return(vers_num); |
---|
503 | } |
---|
504 | |
---|
505 | /* |
---|
506 | * |
---|
507 | * recv_trn_info -- recv a trn_info struct. |
---|
508 | * |
---|
509 | */ |
---|
510 | recv_trn_info(tinfo) |
---|
511 | trn_info *tinfo; |
---|
512 | { |
---|
513 | tinfo -> version = recvint (); |
---|
514 | tinfo -> current = recvint (); |
---|
515 | tinfo -> prev = recvint (); |
---|
516 | tinfo -> next = recvint (); |
---|
517 | tinfo -> pref = recvint (); |
---|
518 | tinfo -> nref = recvint (); |
---|
519 | tinfo -> fref = recvint (); |
---|
520 | tinfo -> lref = recvint (); |
---|
521 | tinfo -> chain_index = recvint (); |
---|
522 | tinfo -> date_entered = recvint (); |
---|
523 | tinfo -> num_lines = recvint (); |
---|
524 | tinfo -> num_chars = recvint (); |
---|
525 | tinfo -> subject = recvstr (); |
---|
526 | tinfo -> author = recvstr (); |
---|
527 | } |
---|
528 | |
---|
529 | /* |
---|
530 | * |
---|
531 | * recv_trn_info2 -- recv a trn_info2 struct. |
---|
532 | * |
---|
533 | */ |
---|
534 | recv_trn_info2(tinfo) |
---|
535 | trn_info2 *tinfo; |
---|
536 | { |
---|
537 | tinfo -> version = recvint (); |
---|
538 | tinfo -> current = recvint (); |
---|
539 | tinfo -> prev = recvint (); |
---|
540 | tinfo -> next = recvint (); |
---|
541 | tinfo -> pref = recvint (); |
---|
542 | tinfo -> nref = recvint (); |
---|
543 | tinfo -> fref = recvint (); |
---|
544 | tinfo -> lref = recvint (); |
---|
545 | tinfo -> chain_index = recvint (); |
---|
546 | tinfo -> date_entered = recvint (); |
---|
547 | tinfo -> num_lines = recvint (); |
---|
548 | tinfo -> num_chars = recvint (); |
---|
549 | tinfo -> subject = recvstr (); |
---|
550 | tinfo -> author = recvstr (); |
---|
551 | tinfo -> flags = recvint (); |
---|
552 | } |
---|
553 | |
---|
554 | /* |
---|
555 | * |
---|
556 | * old_recv_mtg_info -- Recv a mtg info struct. |
---|
557 | * |
---|
558 | */ |
---|
559 | old_recv_mtg_info(minfo) |
---|
560 | mtg_info *minfo; |
---|
561 | { |
---|
562 | minfo -> version = recvint (); |
---|
563 | minfo -> location = recvstr (); |
---|
564 | minfo -> long_name = recvstr (); |
---|
565 | minfo -> chairman = recvstr (); |
---|
566 | minfo -> first = recvint (); |
---|
567 | minfo -> last = recvint (); |
---|
568 | minfo -> lowest = recvint (); |
---|
569 | minfo -> highest = recvint (); |
---|
570 | minfo -> date_created = recvint (); |
---|
571 | minfo -> date_modified = recvint (); |
---|
572 | minfo -> public_flag = recvbool (); |
---|
573 | } |
---|
574 | |
---|
575 | /* |
---|
576 | * |
---|
577 | * recv_mtg_info -- Recv a mtg info struct. |
---|
578 | * |
---|
579 | */ |
---|
580 | recv_mtg_info(minfo) |
---|
581 | mtg_info *minfo; |
---|
582 | { |
---|
583 | minfo -> version = recvint (); |
---|
584 | minfo -> location = recvstr (); |
---|
585 | minfo -> long_name = recvstr (); |
---|
586 | minfo -> chairman = recvstr (); |
---|
587 | minfo -> first = recvint (); |
---|
588 | minfo -> last = recvint (); |
---|
589 | minfo -> lowest = recvint (); |
---|
590 | minfo -> highest = recvint (); |
---|
591 | minfo -> date_created = recvint (); |
---|
592 | minfo -> date_modified = recvint (); |
---|
593 | minfo -> public_flag = recvbool (); |
---|
594 | minfo -> access_modes = recvstr (); |
---|
595 | } |
---|
596 | |
---|
597 | dsc_acl *recv_acl() |
---|
598 | { |
---|
599 | char *malloc(); |
---|
600 | /* The following code would lose points in 6.170... */ |
---|
601 | register dsc_acl *result = (dsc_acl *) malloc(sizeof(dsc_acl)); |
---|
602 | register dsc_acl_entry *ae; |
---|
603 | register unsigned int len; |
---|
604 | len = recvint(); |
---|
605 | result->acl_length = len; |
---|
606 | if (len > 1000) /* Bogus! */ { |
---|
607 | /*XXX Put some error checking in here */ |
---|
608 | } |
---|
609 | result->acl_entries = |
---|
610 | (dsc_acl_entry *) malloc(sizeof(dsc_acl_entry) * len); |
---|
611 | for (ae = result->acl_entries; len; --len, ++ae) { |
---|
612 | ae->modes = recvstr(); |
---|
613 | ae->principal = recvstr(); |
---|
614 | } |
---|
615 | return result; |
---|
616 | } |
---|
617 | |
---|