d4ac42e96146ee7c1ffc4ca56e7bb78afa995a56
[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 cntr_entries_0;
94         TALLOC_CTX *_mem_save_entries_0;
95         if (ndr_flags & NDR_SCALARS) {
96                 NDR_CHECK(ndr_pull_align(ndr, 8));
97                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_mask));
98                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_mask_subdir));
99                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_entries));
100                 NDR_PULL_ALLOC_N(ndr, r->entries, r->num_entries);
101                 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
102                 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
103                 for (cntr_entries_0 = 0; cntr_entries_0 < r->num_entries; cntr_entries_0++) {
104                         NDR_CHECK(ndr_pull_notify_entry(ndr, NDR_SCALARS, &r->entries[cntr_entries_0]));
105                 }
106                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
107         }
108         if (ndr_flags & NDR_BUFFERS) {
109                 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
110                 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
111                 for (cntr_entries_0 = 0; cntr_entries_0 < r->num_entries; cntr_entries_0++) {
112                         NDR_CHECK(ndr_pull_notify_entry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_0]));
113                 }
114                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
115         }
116         return NDR_ERR_SUCCESS;
117 }
118
119 _PUBLIC_ void ndr_print_notify_depth(struct ndr_print *ndr, const char *name, const struct notify_depth *r)
120 {
121         uint32_t cntr_entries_0;
122         ndr_print_struct(ndr, name, "notify_depth");
123         ndr->depth++;
124         ndr_print_uint32(ndr, "max_mask", r->max_mask);
125         ndr_print_uint32(ndr, "max_mask_subdir", r->max_mask_subdir);
126         ndr_print_uint32(ndr, "num_entries", r->num_entries);
127         ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->num_entries);
128         ndr->depth++;
129         for (cntr_entries_0=0;cntr_entries_0<r->num_entries;cntr_entries_0++) {
130                 char *idx_0=NULL;
131                 if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) {
132                         ndr_print_notify_entry(ndr, "entries", &r->entries[cntr_entries_0]);
133                         free(idx_0);
134                 }
135         }
136         ndr->depth--;
137         ndr->depth--;
138 }
139
140 _PUBLIC_ enum ndr_err_code ndr_push_notify_array(struct ndr_push *ndr, int ndr_flags, const struct notify_array *r)
141 {
142         uint32_t cntr_depth_0;
143         if (ndr_flags & NDR_SCALARS) {
144                 NDR_CHECK(ndr_push_align(ndr, 8));
145                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_depths));
146                 for (cntr_depth_0 = 0; cntr_depth_0 < r->num_depths; cntr_depth_0++) {
147                         NDR_CHECK(ndr_push_notify_depth(ndr, NDR_SCALARS, &r->depth[cntr_depth_0]));
148                 }
149         }
150         if (ndr_flags & NDR_BUFFERS) {
151                 for (cntr_depth_0 = 0; cntr_depth_0 < r->num_depths; cntr_depth_0++) {
152                         NDR_CHECK(ndr_push_notify_depth(ndr, NDR_BUFFERS, &r->depth[cntr_depth_0]));
153                 }
154         }
155         return NDR_ERR_SUCCESS;
156 }
157
158 _PUBLIC_ enum ndr_err_code ndr_pull_notify_array(struct ndr_pull *ndr, int ndr_flags, struct notify_array *r)
159 {
160         uint32_t cntr_depth_0;
161         TALLOC_CTX *_mem_save_depth_0;
162         if (ndr_flags & NDR_SCALARS) {
163                 NDR_CHECK(ndr_pull_align(ndr, 8));
164                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_depths));
165                 NDR_PULL_ALLOC_N(ndr, r->depth, r->num_depths);
166                 _mem_save_depth_0 = NDR_PULL_GET_MEM_CTX(ndr);
167                 NDR_PULL_SET_MEM_CTX(ndr, r->depth, 0);
168                 for (cntr_depth_0 = 0; cntr_depth_0 < r->num_depths; cntr_depth_0++) {
169                         NDR_CHECK(ndr_pull_notify_depth(ndr, NDR_SCALARS, &r->depth[cntr_depth_0]));
170                 }
171                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_depth_0, 0);
172         }
173         if (ndr_flags & NDR_BUFFERS) {
174                 _mem_save_depth_0 = NDR_PULL_GET_MEM_CTX(ndr);
175                 NDR_PULL_SET_MEM_CTX(ndr, r->depth, 0);
176                 for (cntr_depth_0 = 0; cntr_depth_0 < r->num_depths; cntr_depth_0++) {
177                         NDR_CHECK(ndr_pull_notify_depth(ndr, NDR_BUFFERS, &r->depth[cntr_depth_0]));
178                 }
179                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_depth_0, 0);
180         }
181         return NDR_ERR_SUCCESS;
182 }
183
184 _PUBLIC_ void ndr_print_notify_array(struct ndr_print *ndr, const char *name, const struct notify_array *r)
185 {
186         uint32_t cntr_depth_0;
187         ndr_print_struct(ndr, name, "notify_array");
188         ndr->depth++;
189         ndr_print_uint32(ndr, "num_depths", r->num_depths);
190         ndr->print(ndr, "%s: ARRAY(%d)", "depth", (int)r->num_depths);
191         ndr->depth++;
192         for (cntr_depth_0=0;cntr_depth_0<r->num_depths;cntr_depth_0++) {
193                 char *idx_0=NULL;
194                 if (asprintf(&idx_0, "[%d]", cntr_depth_0) != -1) {
195                         ndr_print_notify_depth(ndr, "depth", &r->depth[cntr_depth_0]);
196                         free(idx_0);
197                 }
198         }
199         ndr->depth--;
200         ndr->depth--;
201 }
202
203 _PUBLIC_ enum ndr_err_code ndr_push_notify_event(struct ndr_push *ndr, int ndr_flags, const struct notify_event *r)
204 {
205         if (ndr_flags & NDR_SCALARS) {
206                 NDR_CHECK(ndr_push_align(ndr, 8));
207                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->action));
208                 {
209                         uint32_t _flags_save_string = ndr->flags;
210                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
211                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path));
212                         ndr->flags = _flags_save_string;
213                 }
214                 NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->private_data));
215         }
216         if (ndr_flags & NDR_BUFFERS) {
217         }
218         return NDR_ERR_SUCCESS;
219 }
220
221 _PUBLIC_ enum ndr_err_code ndr_pull_notify_event(struct ndr_pull *ndr, int ndr_flags, struct notify_event *r)
222 {
223         if (ndr_flags & NDR_SCALARS) {
224                 NDR_CHECK(ndr_pull_align(ndr, 8));
225                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->action));
226                 {
227                         uint32_t _flags_save_string = ndr->flags;
228                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
229                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path));
230                         ndr->flags = _flags_save_string;
231                 }
232                 NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->private_data));
233         }
234         if (ndr_flags & NDR_BUFFERS) {
235         }
236         return NDR_ERR_SUCCESS;
237 }
238
239 _PUBLIC_ void ndr_print_notify_event(struct ndr_print *ndr, const char *name, const struct notify_event *r)
240 {
241         ndr_print_struct(ndr, name, "notify_event");
242         ndr->depth++;
243         ndr_print_uint32(ndr, "action", r->action);
244         ndr_print_string(ndr, "path", r->path);
245         ndr_print_pointer(ndr, "private_data", r->private_data);
246         ndr->depth--;
247 }
248