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