rtable2.x 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /* $XConsortium: rtable2.x /main/1 1996/04/21 19:24:30 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_2<>;
  16. enum Transaction_2 {
  17. add_2, cm_remove_2
  18. };
  19. enum Period_2 {
  20. single_2, daily_2, weekly_2, biweekly_2, monthly_2, yearly_2,
  21. nthWeekday_2, everyNthDay_2, everyNthWeek_2,
  22. everyNthMonth_2, otherPeriod_2
  23. };
  24. enum Tag_2{
  25. appointment_2, reminder_2, otherTag_2
  26. };
  27. struct Attribute_2 {
  28. struct Attribute_2 *next;
  29. Buffer_2 attr;
  30. Buffer_2 value;
  31. };
  32. typedef Attribute_2 *Attr_2;
  33. struct Except_2 {
  34. int ordinal;
  35. struct Except_2 *next;
  36. };
  37. typedef Except_2 *Exception_2;
  38. struct Id_2 {
  39. time_t tick; /* user specified time stored as GMT */
  40. long key; /* system assigned id */
  41. };
  42. struct Uid_2 {
  43. struct Id_2 appt_id;
  44. struct Uid_2 *next;
  45. };
  46. struct Appt_2 {
  47. struct Id_2 appt_id; /* appointment/repeater id */
  48. Tag_2 tag; /* appointment or otherTag */
  49. int duration; /* appt duration in seconds */
  50. int ntimes; /* n repeat times (0 .. forever) */
  51. Buffer_2 what; /* text of appointment */
  52. Buffer_2 mailto; /* addressee of mail reminder */
  53. Buffer_2 script; /* text of unix script for script reminder */
  54. Period_2 period; /* periodicity of event: single default */
  55. Buffer_2 author; /* user who inserted the appt */
  56. Buffer_2 client_data; /* TBD. */
  57. struct Except_2 *exception; /* list of exceptions to repeating events */
  58. struct Attribute_2 *attr; /* list of reminder attributes */
  59. struct Appt_2 *next; /* next appointment */
  60. };
  61. struct Abb_Appt_2 {
  62. struct Id_2 appt_id;
  63. Buffer_2 what;
  64. int duration;
  65. Period_2 period;
  66. struct Abb_Appt_2 *next;
  67. };
  68. struct Apptid_2 {
  69. struct Id_2 *oid; /* old appt key */
  70. struct Appt_2 *new_appt; /* new appt */
  71. };
  72. struct Reminder_2 {
  73. struct Id_2 appt_id; /* actual appt. key */
  74. time_t tick; /* the happening tick */
  75. Attribute_2 attr; /* (attr, value) */
  76. struct Reminder_2 *next;
  77. };
  78. enum Table_Res_Type_2 {AP_2, RM_2, AB_2, ID_2};
  79. union Table_Res_List_2 switch (Table_Res_Type_2 tag) {
  80. case AP_2:
  81. Appt_2 *a;
  82. case RM_2:
  83. Reminder_2 *r;
  84. case AB_2:
  85. Abb_Appt_2 *b;
  86. case ID_2:
  87. Uid_2 *i;
  88. default:
  89. void;
  90. };
  91. enum Access_Status_2 {
  92. access_ok_2,
  93. access_added_2,
  94. access_removed_2,
  95. access_failed_2,
  96. access_exists_2,
  97. access_partial_2,
  98. access_other_2
  99. };
  100. struct Table_Res_2 {
  101. Access_Status_2 status;
  102. Table_Res_List_2 res;
  103. };
  104. %#define access_none_2 0x0 /* owner only */
  105. %#define access_read_2 0x1
  106. %#define access_write_2 0x2
  107. %#define access_delete_2 0x4
  108. %#define access_exec_2 0x8 /* execution permission is a hack! */
  109. %#define VOIDPID -1 /* pre-V3 tools do present pids */
  110. struct Access_Entry_2 {
  111. Buffer_2 who;
  112. int access_type; /* Bit mask from access_read,write,delete */
  113. Access_Entry_2 *next;
  114. };
  115. struct Access_Args_2 {
  116. Buffer_2 target;
  117. Access_Entry_2 *access_list;
  118. };
  119. struct Range_2 {
  120. time_t key1; /* lower bound tick */
  121. time_t key2; /* upper bound tick */
  122. struct Range_2 *next;
  123. };
  124. enum Table_Args_Type_2 {TICK_2, APPTID_2, UID_2, APPT_2, RANGE_2};
  125. union Args_2 switch (Table_Args_Type_2 tag) {
  126. case TICK_2:
  127. time_t tick;
  128. case APPTID_2:
  129. Apptid_2 apptid;
  130. case UID_2:
  131. Uid_2 *key;
  132. case APPT_2:
  133. Appt_2 *appt;
  134. case RANGE_2:
  135. Range_2 *range;
  136. };
  137. struct Table_Args_2 {
  138. Buffer_2 target;
  139. Args_2 args;
  140. };
  141. struct Registration_2 {
  142. Buffer_2 target;
  143. u_long prognum;
  144. u_long versnum;
  145. u_long procnum;
  146. struct Registration_2 *next;
  147. };
  148. enum Table_Status_2 {ok_2, duplicate_2, badtable_2, notable_2, denied_2, other_2};
  149. enum Registration_Status_2 {registered_2, failed_2, deregistered_2, confused_2};
  150. program TABLEPROG {
  151. version TABLEVERS_2 {
  152. void rtable_ping(void) = 0;
  153. Table_Res_2 rtable_lookup(Table_Args_2) = 1;
  154. Table_Res_2 rtable_lookup_next_larger(Table_Args_2) = 2;
  155. Table_Res_2 rtable_lookup_next_smaller(Table_Args_2) = 3;
  156. Table_Res_2 rtable_lookup_range(Table_Args_2) = 4;
  157. Table_Res_2 rtable_abbreviated_lookup_range(Table_Args_2) = 5;
  158. Table_Res_2 rtable_insert(Table_Args_2) = 6;
  159. Table_Res_2 rtable_delete(Table_Args_2) = 7;
  160. Table_Res_2 rtable_delete_instance(Table_Args_2) = 8;
  161. Table_Res_2 rtable_change(Table_Args_2) = 9;
  162. Table_Res_2 rtable_change_instance(Table_Args_2) = 10;
  163. Table_Res_2 rtable_lookup_next_reminder(Table_Args_2) = 11;
  164. Table_Status_2 rtable_check(Table_Args_2) = 12;
  165. Table_Status_2 rtable_flush_table(Table_Args_2) = 13;
  166. int rtable_size(Table_Args_2) = 14;
  167. Registration_Status_2 register_callback(Registration_2) = 15;
  168. Registration_Status_2 deregister_callback(Registration_2) = 16;
  169. Access_Status_2 rtable_set_access(Access_Args_2) = 17;
  170. Access_Args_2 rtable_get_access(Access_Args_2) = 18;
  171. } = 2;
  172. } = 100068;