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