rtable3.x 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /* $XConsortium: rtable3.x /main/1 1996/04/21 19:24:37 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_3<>;
  16. enum Transaction_3 {
  17. add_3, cm_remove_3
  18. };
  19. enum Interval_3 {
  20. single_3, daily_3, weekly_3, biweekly_3, monthly_3, yearly_3,
  21. nthWeekday_3, everyNthDay_3, everyNthWeek_3,
  22. everyNthMonth_3, otherPeriod_3
  23. };
  24. struct Period_3 {
  25. Interval_3 period;
  26. int nth;
  27. };
  28. enum Event_Type_3 {
  29. appointment_3, reminder_3, otherTag_3, holiday_3, toDo_3
  30. };
  31. struct Tag_3 {
  32. Event_Type_3 tag;
  33. int showtime; /* Advisory for formatting time */
  34. struct Tag_3 *next;
  35. };
  36. enum Privacy_Level_3 {
  37. public_3, private_3, semiprivate_3
  38. };
  39. struct Attribute_3 {
  40. struct Attribute_3 *next;
  41. Buffer_3 attr;
  42. Buffer_3 value;
  43. Buffer_3 clientdata;
  44. };
  45. typedef Attribute_3 *Attr_3;
  46. struct Except_3 {
  47. int ordinal;
  48. struct Except_3 *next;
  49. };
  50. typedef Except_3 *Exception_3;
  51. struct Id_3 {
  52. time_t tick; /* user specified time stored as GMT */
  53. long key; /* system assigned id */
  54. };
  55. struct Uid_3 {
  56. struct Id_3 appt_id;
  57. struct Uid_3 *next;
  58. };
  59. enum Appt_Status_3 {
  60. active_3, pendingAdd_3, pendingDelete_3, committed_3,
  61. cancelled_3, completed_3
  62. };
  63. struct Appt_3 {
  64. struct Id_3 appt_id; /* appointment/repeater id */
  65. struct Tag_3 *tag; /* event type & advisory time display */
  66. int duration; /* appt duration in seconds */
  67. int ntimes; /* n repeat times (0 .. forever) */
  68. Buffer_3 what; /* text of appointment */
  69. struct Period_3 period; /* periodicity of event: single default */
  70. Buffer_3 author; /* user who inserted the appt */
  71. Buffer_3 client_data; /* TBD. */
  72. struct Except_3 *exception; /* list of exceptions to repeating events */
  73. struct Attribute_3 *attr; /* list of reminder attributes */
  74. Appt_Status_3 appt_status;
  75. Privacy_Level_3 privacy;
  76. struct Appt_3 *next; /* next appointment */
  77. };
  78. struct Abb_Appt_3 {
  79. struct Id_3 appt_id;
  80. struct Tag_3 *tag;
  81. Buffer_3 what;
  82. int duration;
  83. struct Period_3 period;
  84. struct Abb_Appt_3 *next;
  85. Appt_Status_3 appt_status;
  86. Privacy_Level_3 privacy;
  87. };
  88. struct Apptid_3 {
  89. struct Id_3 *oid; /* old appt key */
  90. struct Appt_3 *new_appt; /* new appt */
  91. };
  92. struct Reminder_3 {
  93. struct Id_3 appt_id; /* actual appt. key */
  94. time_t tick; /* the happening tick */
  95. Attribute_3 attr; /* (attr, value) */
  96. struct Reminder_3 *next;
  97. };
  98. enum Table_Res_Type_3 {AP_3, RM_3, AB_3, ID_3};
  99. union Table_Res_List_3 switch (Table_Res_Type_3 tag) {
  100. case AP_3:
  101. Appt_3 *a;
  102. case RM_3:
  103. Reminder_3 *r;
  104. case AB_3:
  105. Abb_Appt_3 *b;
  106. case ID_3:
  107. Uid_3 *i;
  108. default:
  109. void;
  110. };
  111. enum Access_Status_3 {
  112. access_ok_3,
  113. access_added_3,
  114. access_removed_3,
  115. access_failed_3,
  116. access_exists_3,
  117. access_partial_3,
  118. access_other_3
  119. };
  120. struct Table_Res_3 {
  121. Access_Status_3 status;
  122. Table_Res_List_3 res;
  123. };
  124. %#define access_none_3 0x0 /* owner only */
  125. %#define access_read_3 0x1
  126. %#define access_write_3 0x2
  127. %#define access_delete_3 0x4
  128. %#define access_exec_3 0x8 /* execution permission is a hack! */
  129. struct Access_Entry_3 {
  130. Buffer_3 who;
  131. int access_type; /* Bit mask from access_read,write,delete */
  132. Access_Entry_3 *next;
  133. };
  134. struct Access_Args_3 {
  135. Buffer_3 target;
  136. Access_Entry_3 *access_list;
  137. };
  138. struct Range_3 {
  139. time_t key1; /* lower bound tick */
  140. time_t key2; /* upper bound tick */
  141. struct Range_3 *next;
  142. };
  143. struct Keyrange_3 {
  144. long key; /* key of appt */
  145. time_t tick1; /* lower bound tick */
  146. time_t tick2; /* upper bound tick */
  147. struct Keyrange_3 *next;
  148. };
  149. enum Table_Args_Type_3 {TICK_3, APPTID_3, UID_3, APPT_3, RANGE_3, KEYRANGE_3};
  150. union Args_3 switch (Table_Args_Type_3 tag) {
  151. case TICK_3:
  152. time_t tick;
  153. case APPTID_3:
  154. Apptid_3 apptid;
  155. case UID_3:
  156. Uid_3 *key;
  157. case APPT_3:
  158. Appt_3 *appt;
  159. case RANGE_3:
  160. Range_3 *range;
  161. case KEYRANGE_3:
  162. Keyrange_3 *keyrange;
  163. };
  164. struct Table_Args_3 {
  165. Buffer_3 target;
  166. Args_3 args;
  167. int pid;
  168. };
  169. struct Registration_3 {
  170. Buffer_3 target;
  171. u_long prognum;
  172. u_long versnum;
  173. u_long procnum;
  174. struct Registration_3 *next;
  175. int pid;
  176. };
  177. enum Table_Status_3 {ok_3, duplicate_3, badtable_3, notable_3, denied_3, other_3};
  178. enum Registration_Status_3 {registered_3, failed_3, deregistered_3, confused_3};
  179. program TABLEPROG {
  180. version TABLEVERS_3 {
  181. void rtable_ping(void)=0;
  182. Table_Res_3 rtable_lookup(Table_Args_3) = 1;
  183. Table_Res_3 rtable_lookup_next_larger(Table_Args_3) = 2;
  184. Table_Res_3 rtable_lookup_next_smaller(Table_Args_3) = 3;
  185. Table_Res_3 rtable_lookup_range(Table_Args_3) = 4;
  186. Table_Res_3 rtable_abbreviated_lookup_range(Table_Args_3) = 5;
  187. Table_Res_3 rtable_insert(Table_Args_3) = 6;
  188. Table_Res_3 rtable_delete(Table_Args_3) = 7;
  189. Table_Res_3 rtable_delete_instance(Table_Args_3) = 8;
  190. Table_Res_3 rtable_change(Table_Args_3) = 9;
  191. Table_Res_3 rtable_change_instance(Table_Args_3) = 10;
  192. Table_Res_3 rtable_lookup_next_reminder(Table_Args_3) = 11;
  193. Table_Status_3 rtable_check(Table_Args_3) = 12;
  194. Table_Status_3 rtable_flush_table(Table_Args_3) = 13;
  195. int rtable_size(Table_Args_3) = 14;
  196. Registration_Status_3 register_callback(Registration_3) = 15;
  197. Registration_Status_3 deregister_callback(Registration_3) = 16;
  198. Access_Status_3 rtable_set_access(Access_Args_3) = 17;
  199. Access_Args_3 rtable_get_access(Access_Args_3) = 18;
  200. Table_Res_3 rtable_abbreviated_lookup_key_range(Table_Args_3) = 19;
  201. long rtable_gmtoff(void) = 20;
  202. } = 3;
  203. } = 100068;