rerun 'make samba3-idl'
[samba.git] / source3 / librpc / gen_ndr / ndr_notify.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_notify.h"
5
6 _PUBLIC_ enum ndr_err_code ndr_push_notify_entry(struct ndr_push *ndr, int ndr_flags, const struct notify_entry *r)
7 {
8         if (ndr_flags & NDR_SCALARS) {
9                 NDR_CHECK(ndr_push_align(ndr, 8));
10                 NDR_CHECK(ndr_push_server_id(ndr, NDR_SCALARS, &r->server));
11                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->filter));
12                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->subdir_filter));
13                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dir_fd));
14                 NDR_CHECK(ndr_push_file_id(ndr, NDR_SCALARS, &r->dir_id));
15                 {
16                         uint32_t _flags_save_string = ndr->flags;
17                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
18                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path));
19                         ndr->flags = _flags_save_string;
20                 }
21                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->path_len));
22                 NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->private_data));
23         }
24         if (ndr_flags & NDR_BUFFERS) {
25                 NDR_CHECK(ndr_push_server_id(ndr, NDR_BUFFERS, &r->server));
26                 NDR_CHECK(ndr_push_file_id(ndr, NDR_BUFFERS, &r->dir_id));
27         }
28         return NDR_ERR_SUCCESS;
29 }
30
31 _PUBLIC_ enum ndr_err_code ndr_pull_notify_entry(struct ndr_pull *ndr, int ndr_flags, struct notify_entry *r)
32 {
33         if (ndr_flags & NDR_SCALARS) {
34                 NDR_CHECK(ndr_pull_align(ndr, 8));
35                 NDR_CHECK(ndr_pull_server_id(ndr, NDR_SCALARS, &r->server));
36                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->filter));
37                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->subdir_filter));
38                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dir_fd));
39                 NDR_CHECK(ndr_pull_file_id(ndr, NDR_SCALARS, &r->dir_id));
40                 {
41                         uint32_t _flags_save_string = ndr->flags;
42                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
43                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path));
44                         ndr->flags = _flags_save_string;
45                 }
46                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->path_len));
47                 NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->private_data));
48         }
49         if (ndr_flags & NDR_BUFFERS) {
50                 NDR_CHECK(ndr_pull_server_id(ndr, NDR_BUFFERS, &r->server));
51                 NDR_CHECK(ndr_pull_file_id(ndr, NDR_BUFFERS, &r->dir_id));
52         }
53         return NDR_ERR_SUCCESS;
54 }
55
56 _PUBLIC_ void ndr_print_notify_entry(struct ndr_print *ndr, const char *name, const struct notify_entry *r)
57 {
58         ndr_print_struct(ndr, name, "notify_entry");
59         ndr->depth++;
60         ndr_print_server_id(ndr, "server", &r->server);
61         ndr_print_uint32(ndr, "filter", r->filter);
62         ndr_print_uint32(ndr, "subdir_filter", r->subdir_filter);
63         ndr_print_uint32(ndr, "dir_fd", r->dir_fd);
64         ndr_print_file_id(ndr, "dir_id", &r->dir_id);
65         ndr_print_string(ndr, "path", r->path);
66         ndr_print_uint32(ndr, "path_len", r->path_len);
67         ndr_print_pointer(ndr, "private_data", r->private_data);
68         ndr->depth--;
69 }
70
71 static enum ndr_err_code ndr_push_notify_depth(struct ndr_push *ndr, int ndr_flags, const struct notify_depth *r)
72 {
73         uint32_t cntr_entries_0;
74         if (ndr_flags & NDR_SCALARS) {
75                 NDR_CHECK(ndr_push_align(ndr, 8));
76                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_mask));
77                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_mask_subdir));
78                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_entries));
79                 for (cntr_entries_0 = 0; cntr_entries_0 < r->num_entries; cntr_entries_0++) {
80                         NDR_CHECK(ndr_push_notify_entry(ndr, NDR_SCALARS, &r->entries[cntr_entries_0]));
81                 }
82         }
83         if (ndr_flags & NDR_BUFFERS) {
84                 for (cntr_entries_0 = 0; cntr_entries_0 < r->num_entries; cntr_entries_0++) {
85                         NDR_CHECK(ndr_push_notify_entry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_0]));
86                 }
87         }
88         return NDR_ERR_SUCCESS;
89 }
90
91 static enum ndr_err_code ndr_pull_notify_depth(struct ndr_pull *ndr, int ndr_flags, struct notify_depth *r)
92 {
93         uint32_t size_entries_0 = 0;
94         uint32_t cntr_entries_0;
95         TALLOC_CTX *_mem_save_entries_0;
96         if (ndr_flags & NDR_SCALARS) {
97                 NDR_CHECK(ndr_pull_align(ndr, 8));
98                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_mask));
99                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_mask_subdir));
100                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_entries));
101                 size_entries_0 = r->num_entries;
102                 NDR_PULL_ALLOC_N(ndr, r->entries, size_entries_0);
103                 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
104                 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
105                 for (cntr_entries_0 = 0; cntr_entries_0 < size_entries_0; cntr_entries_0++) {
106                         NDR_CHECK(ndr_pull_notify_entry(ndr, NDR_SCALARS, &r->entries[cntr_entries_0]));
107                 }
108                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
109         }
110         if (ndr_flags & NDR_BUFFERS) {
111                 size_entries_0 = r->num_entries;
112                 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
113                 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
114                 for (cntr_entries_0 = 0; cntr_entries_0 < size_entries_0; cntr_entries_0++) {
115                         NDR_CHECK(ndr_pull_notify_entry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_0]));
116                 }
117                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
118         }
119         return NDR_ERR_SUCCESS;
120 }
121
122 _PUBLIC_ void ndr_print_notify_depth(struct ndr_print *ndr, const char *name, const struct notify_depth *r)
123 {
124         uint32_t cntr_entries_0;
125         ndr_print_struct(ndr, name, "notify_depth");
126         ndr->depth++;
127         ndr_print_uint32(ndr, "max_mask", r->max_mask);
128         ndr_print_uint32(ndr, "max_mask_subdir", r->max_mask_subdir);
129         ndr_print_uint32(ndr, "num_entries", r->num_entries);
130         ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->num_entries);
131         ndr->depth++;
132         for (cntr_entries_0=0;cntr_entries_0<r->num_entries;cntr_entries_0++) {
133                 char *idx_0=NULL;
134                 if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) {
135                         ndr_print_notify_entry(ndr, "entries", &r->entries[cntr_entries_0]);
136                         free(idx_0);
137                 }
138         }
139         ndr->depth--;
140         ndr->depth--;
141 }
142
143 _PUBLIC_ enum ndr_err_code ndr_push_notify_array(struct ndr_push *ndr, int ndr_flags, const struct notify_array *r)
144 {
145         uint32_t cntr_depth_0;
146         if (ndr_flags & NDR_SCALARS) {
147                 NDR_CHECK(ndr_push_align(ndr, 8));
148                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_depths));
149                 for (cntr_depth_0 = 0; cntr_depth_0 < r->num_depths; cntr_depth_0++) {
150                         NDR_CHECK(ndr_push_notify_depth(ndr, NDR_SCALARS, &r->depth[cntr_depth_0]));
151                 }
152         }
153         if (ndr_flags & NDR_BUFFERS) {
154                 for (cntr_depth_0 = 0; cntr_depth_0 < r->num_depths; cntr_depth_0++) {
155                         NDR_CHECK(ndr_push_notify_depth(ndr, NDR_BUFFERS, &r->depth[cntr_depth_0]));
156                 }
157         }
158         return NDR_ERR_SUCCESS;
159 }
160
161 _PUBLIC_ enum ndr_err_code ndr_pull_notify_array(struct ndr_pull *ndr, int ndr_flags, struct notify_array *r)
162 {
163         uint32_t size_depth_0 = 0;
164         uint32_t cntr_depth_0;
165         TALLOC_CTX *_mem_save_depth_0;
166         if (ndr_flags & NDR_SCALARS) {
167                 NDR_CHECK(ndr_pull_align(ndr, 8));
168                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_depths));
169                 size_depth_0 = r->num_depths;
170                 NDR_PULL_ALLOC_N(ndr, r->depth, size_depth_0);
171                 _mem_save_depth_0 = NDR_PULL_GET_MEM_CTX(ndr);
172                 NDR_PULL_SET_MEM_CTX(ndr, r->depth, 0);
173                 for (cntr_depth_0 = 0; cntr_depth_0 < size_depth_0; cntr_depth_0++) {
174                         NDR_CHECK(ndr_pull_notify_depth(ndr, NDR_SCALARS, &r->depth[cntr_depth_0]));
175                 }
176                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_depth_0, 0);
177         }
178         if (ndr_flags & NDR_BUFFERS) {
179                 size_depth_0 = r->num_depths;
180                 _mem_save_depth_0 = NDR_PULL_GET_MEM_CTX(ndr);
181                 NDR_PULL_SET_MEM_CTX(ndr, r->depth, 0);
182                 for (cntr_depth_0 = 0; cntr_depth_0 < size_depth_0; cntr_depth_0++) {
183                         NDR_CHECK(ndr_pull_notify_depth(ndr, NDR_BUFFERS, &r->depth[cntr_depth_0]));
184                 }
185                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_depth_0, 0);
186         }
187         return NDR_ERR_SUCCESS;
188 }
189
190 _PUBLIC_ void ndr_print_notify_array(struct ndr_print *ndr, const char *name, const struct notify_array *r)
191 {
192         uint32_t cntr_depth_0;
193         ndr_print_struct(ndr, name, "notify_array");
194         ndr->depth++;
195         ndr_print_uint32(ndr, "num_depths", r->num_depths);
196         ndr->print(ndr, "%s: ARRAY(%d)", "depth", (int)r->num_depths);
197         ndr->depth++;
198         for (cntr_depth_0=0;cntr_depth_0<r->num_depths;cntr_depth_0++) {
199                 char *idx_0=NULL;
200                 if (asprintf(&idx_0, "[%d]", cntr_depth_0) != -1) {
201                         ndr_print_notify_depth(ndr, "depth", &r->depth[cntr_depth_0]);
202                         free(idx_0);
203                 }
204         }
205         ndr->depth--;
206         ndr->depth--;
207 }
208
209 _PUBLIC_ enum ndr_err_code ndr_push_notify_event(struct ndr_push *ndr, int ndr_flags, const struct notify_event *r)
210 {
211         if (ndr_flags & NDR_SCALARS) {
212                 NDR_CHECK(ndr_push_align(ndr, 8));
213                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->action));
214                 {
215                         uint32_t _flags_save_string = ndr->flags;
216                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
217                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path));
218                         ndr->flags = _flags_save_string;
219                 }
220                 NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->private_data));
221         }
222         if (ndr_flags & NDR_BUFFERS) {
223         }
224         return NDR_ERR_SUCCESS;
225 }
226
227 _PUBLIC_ enum ndr_err_code ndr_pull_notify_event(struct ndr_pull *ndr, int ndr_flags, struct notify_event *r)
228 {
229         if (ndr_flags & NDR_SCALARS) {
230                 NDR_CHECK(ndr_pull_align(ndr, 8));
231                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->action));
232                 {
233                         uint32_t _flags_save_string = ndr->flags;
234                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
235                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path));
236                         ndr->flags = _flags_save_string;
237                 }
238                 NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->private_data));
239         }
240         if (ndr_flags & NDR_BUFFERS) {
241         }
242         return NDR_ERR_SUCCESS;
243 }
244
245 _PUBLIC_ void ndr_print_notify_event(struct ndr_print *ndr, const char *name, const struct notify_event *r)
246 {
247         ndr_print_struct(ndr, name, "notify_event");
248         ndr->depth++;
249         ndr_print_uint32(ndr, "action", r->action);
250         ndr_print_string(ndr, "path", r->path);
251         ndr_print_pointer(ndr, "private_data", r->private_data);
252         ndr->depth--;
253 }
254