rtable4.x 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /* $XConsortium: rtable4.x /main/1 1996/04/21 19:24:43 drk $ */
  2. /*
  3. * (c) Copyright 1996 Digital Equipment Corporation.
  4. * (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
  5. * (c) Copyright 1993,1994,1996 International Business Machines Corp.
  6. * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
  7. * (c) Copyright 1993,1994,1996 Novell, Inc.
  8. * (c) Copyright 1996 FUJITSU LIMITED.
  9. * (c) Copyright 1996 Hitachi.
  10. */
  11. #ifdef RPC_HDR
  12. %#include "connection.h"
  13. %
  14. #endif
  15. typedef string Buffer_4<>;
  16. enum Interval_4 {
  17. single_4, daily_4, weekly_4, biweekly_4, monthly_4, yearly_4,
  18. nthWeekday_4, everyNthDay_4, everyNthWeek_4,
  19. everyNthMonth_4, otherPeriod_4,
  20. monThruFri_4, monWedFri_4, tueThur_4, daysOfWeek_4
  21. };
  22. struct Period_4 {
  23. Interval_4 period;
  24. int nth;
  25. time_t enddate;
  26. };
  27. enum Event_Type_4 {
  28. appointment_4, reminder_4, otherTag_4, holiday_4, toDo_4
  29. };
  30. enum Options_4 {
  31. do_all_4, do_one_4, do_forward_4
  32. };
  33. struct Tag_4 {
  34. Event_Type_4 tag;
  35. int showtime; /* Advisory for formatting time */
  36. struct Tag_4 *next;
  37. };
  38. enum Privacy_Level_4 {
  39. public_4, private_4, semiprivate_4
  40. };
  41. struct Attribute_4 {
  42. struct Attribute_4 *next;
  43. Buffer_4 attr;
  44. Buffer_4 value;
  45. Buffer_4 clientdata;
  46. };
  47. typedef Attribute_4 *Attr_4;
  48. struct Except_4 {
  49. int ordinal;
  50. struct Except_4 *next;
  51. };
  52. typedef Except_4 *Exception_4;
  53. struct Id_4 {
  54. time_t tick; /* user specified time stored as GMT */
  55. long key; /* system assigned id */
  56. };
  57. struct Uid_4 {
  58. struct Id_4 appt_id;
  59. struct Uid_4 *next;
  60. };
  61. enum Appt_Status_4 {
  62. active_4, pendingAdd_4, pendingDelete_4, committed_4,
  63. cancelled_4, completed_4
  64. };
  65. struct Appt_4 {
  66. struct Id_4 appt_id; /* appointment/repeater id */
  67. struct Tag_4 *tag; /* event type & advisory time display */
  68. int duration; /* appt duration in seconds */
  69. int ntimes; /* n repeat times (0 .. forever) */
  70. Buffer_4 what; /* text of appointment */
  71. struct Period_4 period; /* periodicity of event: single default */
  72. Buffer_4 author; /* user who inserted the appt */
  73. Buffer_4 client_data; /* TBD. */
  74. struct Except_4 *exception; /* list of exceptions to repeating events */
  75. struct Attribute_4 *attr; /* list of reminder attributes */
  76. Appt_Status_4 appt_status;
  77. Privacy_Level_4 privacy;
  78. struct Appt_4 *next; /* next appointment */
  79. };
  80. struct Abb_Appt_4 {
  81. struct Id_4 appt_id;
  82. struct Tag_4 *tag;
  83. Buffer_4 what;
  84. int duration;
  85. struct Period_4 period;
  86. struct Abb_Appt_4 *next;
  87. Appt_Status_4 appt_status;
  88. Privacy_Level_4 privacy;
  89. };
  90. struct Apptid_4 {
  91. struct Id_4 *oid; /* old appt key */
  92. struct Appt_4 *new_appt; /* new appt */
  93. Options_4 option;
  94. };
  95. struct Reminder_4 {
  96. struct Id_4 appt_id; /* actual appt. key */
  97. time_t tick; /* the happening tick */
  98. Attribute_4 attr; /* (attr, value) */
  99. struct Reminder_4 *next;
  100. };
  101. enum Table_Res_Type_4 {AP_4, RM_4, AB_4, ID_4};
  102. union Table_Res_List_4 switch (Table_Res_Type_4 tag) {
  103. case AP_4:
  104. Appt_4 *a;
  105. case RM_4:
  106. Reminder_4 *r;
  107. case AB_4:
  108. Abb_Appt_4 *b;
  109. case ID_4:
  110. Uid_4 *i;
  111. default:
  112. void;
  113. };
  114. enum Access_Status_4 {
  115. access_ok_4,
  116. access_added_4,
  117. access_removed_4,
  118. access_failed_4,
  119. access_exists_4,
  120. access_partial_4,
  121. access_other_4,
  122. access_notable_4,
  123. access_notsupported_4,
  124. access_incomplete_4
  125. };
  126. struct Table_Res_4 {
  127. Access_Status_4 status;
  128. Table_Res_List_4 res;
  129. };
  130. %#define access_none_4 0x0 /* owner only */
  131. %#define access_read_4 0x1
  132. %#define access_write_4 0x2
  133. %#define access_delete_4 0x4
  134. %#define access_exec_4 0x8 /* execution permission is a hack! */
  135. %#define WORLD "world" /* special user */
  136. struct Access_Entry_4 {
  137. Buffer_4 who;
  138. int access_type; /* Bit mask from access_read,write,delete */
  139. Access_Entry_4 *next;
  140. };
  141. struct Access_Args_4 {
  142. Buffer_4 target;
  143. Access_Entry_4 *access_list;
  144. };
  145. struct Range_4 {
  146. time_t key1; /* lower bound tick */
  147. time_t key2; /* upper bound tick */
  148. struct Range_4 *next;
  149. };
  150. struct Keyrange_4 {
  151. long key; /* key of appt */
  152. time_t tick1; /* lower bound tick */
  153. time_t tick2; /* upper bound tick */
  154. struct Keyrange_4 *next;
  155. };
  156. struct Uidopt_4 {
  157. struct Id_4 appt_id;
  158. Options_4 option;
  159. struct Uidopt_4 *next;
  160. };
  161. enum Table_Args_Type_4 {TICK_4, APPTID_4, UID_4, APPT_4, RANGE_4,
  162. KEYRANGE_4, UIDOPT_4};
  163. union Args_4 switch (Table_Args_Type_4 tag) {
  164. case TICK_4:
  165. time_t tick;
  166. case APPTID_4:
  167. Apptid_4 apptid;
  168. case UID_4:
  169. Uid_4 *key;
  170. case APPT_4:
  171. Appt_4 *appt;
  172. case RANGE_4:
  173. Range_4 *range;
  174. case KEYRANGE_4:
  175. Keyrange_4 *keyrange;
  176. case UIDOPT_4:
  177. Uidopt_4 *uidopt;
  178. };
  179. struct Table_Args_4 {
  180. Buffer_4 target;
  181. Args_4 args;
  182. int pid;
  183. };
  184. struct Registration_4 {
  185. Buffer_4 target;
  186. u_long prognum;
  187. u_long versnum;
  188. u_long procnum;
  189. struct Registration_4 *next;
  190. int pid;
  191. };
  192. struct Table_Op_Args_4 {
  193. Buffer_4 target;
  194. Buffer_4 new_target;
  195. };
  196. enum Table_Status_4 {ok_4, duplicate_4, badtable_4, notable_4, denied_4,
  197. other_4, tbl_not_owner_4, tbl_exist_4, tbl_notsupported_4};
  198. enum Registration_Status_4 {registered_4, failed_4, deregistered_4,
  199. confused_4, reg_notable_4};
  200. %
  201. %/*
  202. % * rtable_delete and rtable_change take over the functionality of
  203. % * rtable_delete_instance and rtable_change_instance repectively.
  204. % * rtable_delete_instance and rtable_change_instance are now dummy
  205. % * routines exist for backward compatibility purpose and return
  206. % * access_notsupported.
  207. % */
  208. program TABLEPROG {
  209. version TABLEVERS_4 {
  210. void rtable_ping(void)=0;
  211. Table_Res_4 rtable_lookup(Table_Args_4) = 1;
  212. Table_Res_4 rtable_lookup_next_larger(Table_Args_4) = 2;
  213. Table_Res_4 rtable_lookup_next_smaller(Table_Args_4) = 3;
  214. Table_Res_4 rtable_lookup_range(Table_Args_4) = 4;
  215. Table_Res_4 rtable_abbreviated_lookup_range(Table_Args_4) = 5;
  216. Table_Res_4 rtable_insert(Table_Args_4) = 6;
  217. Table_Res_4 rtable_delete(Table_Args_4) = 7;
  218. Table_Res_4 rtable_delete_instance(Table_Args_4) = 8;
  219. Table_Res_4 rtable_change(Table_Args_4) = 9;
  220. Table_Res_4 rtable_change_instance(Table_Args_4) = 10;
  221. Table_Res_4 rtable_lookup_next_reminder(Table_Args_4) = 11;
  222. Table_Status_4 rtable_check(Table_Args_4) = 12;
  223. Table_Status_4 rtable_flush_table(Table_Args_4) = 13;
  224. int rtable_size(Table_Args_4) = 14;
  225. Registration_Status_4 register_callback(Registration_4) = 15;
  226. Registration_Status_4 deregister_callback(Registration_4) = 16;
  227. Access_Status_4 rtable_set_access(Access_Args_4) = 17;
  228. Access_Args_4 rtable_get_access(Access_Args_4) = 18;
  229. Table_Res_4 rtable_abbreviated_lookup_key_range(Table_Args_4) = 19;
  230. long rtable_gmtoff(void) = 20;
  231. Table_Status_4 rtable_create(Table_Op_Args_4) = 21;
  232. Table_Status_4 rtable_remove(Table_Op_Args_4) = 22;
  233. Table_Status_4 rtable_rename(Table_Op_Args_4) = 23;
  234. } = 4;
  235. } = 100068;