Skip to content

Commit 8470a09

Browse files
committed
style in generate-future-functions.py
1 parent 16815f8 commit 8470a09

File tree

7 files changed

+67
-65
lines changed

7 files changed

+67
-65
lines changed

build/generate-future-functions.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
typedef("mongoc_collection_ptr", "mongoc_collection_t *"),
7676
typedef("mongoc_cursor_ptr", "mongoc_cursor_t *"),
7777
typedef("mongoc_database_ptr", "mongoc_database_t *"),
78-
typedef("mongoc_gridfs_file_t_ptr", "mongoc_gridfs_file_t *"),
78+
typedef("mongoc_gridfs_file_ptr", "mongoc_gridfs_file_t *"),
7979
typedef("mongoc_gridfs_ptr", "mongoc_gridfs_t *"),
8080
typedef("mongoc_insert_flags_t", None),
81-
typedef("mongoc_iovec_t_ptr", "mongoc_iovec_t *"),
81+
typedef("mongoc_iovec_ptr", "mongoc_iovec_t *"),
8282
typedef("mongoc_query_flags_t", None),
8383
typedef("mongoc_server_description_ptr", "mongoc_server_description_t *"),
8484
typedef("mongoc_ss_optype_t", None),
@@ -128,13 +128,15 @@
128128
param("const_bson_ptr", "pipeline"),
129129
param("const_bson_ptr", "options"),
130130
param("const_mongoc_read_prefs_ptr", "read_prefs")]),
131+
131132
future_function("bool",
132133
"mongoc_collection_find_and_modify_with_opts",
133134
[param("mongoc_collection_ptr", "collection"),
134135
param("const_bson_ptr", "query"),
135136
param("const_mongoc_find_and_modify_opts_ptr", "opts"),
136137
param("bson_ptr", "reply"),
137138
param("bson_error_ptr", "error")]),
139+
138140
future_function("bool",
139141
"mongoc_collection_find_and_modify",
140142
[param("mongoc_collection_ptr", "collection"),
@@ -178,22 +180,22 @@
178180

179181
future_function("ssize_t",
180182
"mongoc_gridfs_file_readv",
181-
[param("mongoc_gridfs_file_t_ptr", "file"),
182-
param("mongoc_iovec_t_ptr", "iov"),
183+
[param("mongoc_gridfs_file_ptr", "file"),
184+
param("mongoc_iovec_ptr", "iov"),
183185
param("size_t", "iovcnt"),
184186
param("size_t", "min_bytes"),
185187
param("uint32_t", "timeout_msec")]),
186188

187189
future_function("int",
188190
"mongoc_gridfs_file_seek",
189-
[param("mongoc_gridfs_file_t_ptr", "file"),
191+
[param("mongoc_gridfs_file_ptr", "file"),
190192
param("int64_t", "delta"),
191193
param("int", "whence")]),
192194

193195
future_function("ssize_t",
194196
"mongoc_gridfs_file_writev",
195-
[param("mongoc_gridfs_file_t_ptr", "file"),
196-
param("mongoc_iovec_t_ptr", "iov"),
197+
[param("mongoc_gridfs_file_ptr", "file"),
198+
param("mongoc_iovec_ptr", "iov"),
197199
param("size_t", "iovcnt"),
198200
param("uint32_t", "timeout_msec")]),
199201

tests/mock_server/future-functions.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ background_mongoc_gridfs_file_readv (void *data)
272272
future_value_set_ssize_t (
273273
&return_value,
274274
mongoc_gridfs_file_readv (
275-
future_value_get_mongoc_gridfs_file_t_ptr (future_get_param (future, 0)),
276-
future_value_get_mongoc_iovec_t_ptr (future_get_param (future, 1)),
275+
future_value_get_mongoc_gridfs_file_ptr (future_get_param (future, 0)),
276+
future_value_get_mongoc_iovec_ptr (future_get_param (future, 1)),
277277
future_value_get_size_t (future_get_param (future, 2)),
278278
future_value_get_size_t (future_get_param (future, 3)),
279279
future_value_get_uint32_t (future_get_param (future, 4))
@@ -295,7 +295,7 @@ background_mongoc_gridfs_file_seek (void *data)
295295
future_value_set_int (
296296
&return_value,
297297
mongoc_gridfs_file_seek (
298-
future_value_get_mongoc_gridfs_file_t_ptr (future_get_param (future, 0)),
298+
future_value_get_mongoc_gridfs_file_ptr (future_get_param (future, 0)),
299299
future_value_get_int64_t (future_get_param (future, 1)),
300300
future_value_get_int (future_get_param (future, 2))
301301
));
@@ -316,8 +316,8 @@ background_mongoc_gridfs_file_writev (void *data)
316316
future_value_set_ssize_t (
317317
&return_value,
318318
mongoc_gridfs_file_writev (
319-
future_value_get_mongoc_gridfs_file_t_ptr (future_get_param (future, 0)),
320-
future_value_get_mongoc_iovec_t_ptr (future_get_param (future, 1)),
319+
future_value_get_mongoc_gridfs_file_ptr (future_get_param (future, 0)),
320+
future_value_get_mongoc_iovec_ptr (future_get_param (future, 1)),
321321
future_value_get_size_t (future_get_param (future, 2)),
322322
future_value_get_uint32_t (future_get_param (future, 3))
323323
));
@@ -662,19 +662,19 @@ future_database_get_collection_names (
662662

663663
future_t *
664664
future_gridfs_file_readv (
665-
mongoc_gridfs_file_t_ptr file,
666-
mongoc_iovec_t_ptr iov,
665+
mongoc_gridfs_file_ptr file,
666+
mongoc_iovec_ptr iov,
667667
size_t iovcnt,
668668
size_t min_bytes,
669669
uint32_t timeout_msec)
670670
{
671671
future_t *future = future_new (future_value_ssize_t_type,
672672
5);
673673

674-
future_value_set_mongoc_gridfs_file_t_ptr (
674+
future_value_set_mongoc_gridfs_file_ptr (
675675
future_get_param (future, 0), file);
676676

677-
future_value_set_mongoc_iovec_t_ptr (
677+
future_value_set_mongoc_iovec_ptr (
678678
future_get_param (future, 1), iov);
679679

680680
future_value_set_size_t (
@@ -692,14 +692,14 @@ future_gridfs_file_readv (
692692

693693
future_t *
694694
future_gridfs_file_seek (
695-
mongoc_gridfs_file_t_ptr file,
695+
mongoc_gridfs_file_ptr file,
696696
int64_t delta,
697697
int whence)
698698
{
699699
future_t *future = future_new (future_value_int_type,
700700
3);
701701

702-
future_value_set_mongoc_gridfs_file_t_ptr (
702+
future_value_set_mongoc_gridfs_file_ptr (
703703
future_get_param (future, 0), file);
704704

705705
future_value_set_int64_t (
@@ -714,18 +714,18 @@ future_gridfs_file_seek (
714714

715715
future_t *
716716
future_gridfs_file_writev (
717-
mongoc_gridfs_file_t_ptr file,
718-
mongoc_iovec_t_ptr iov,
717+
mongoc_gridfs_file_ptr file,
718+
mongoc_iovec_ptr iov,
719719
size_t iovcnt,
720720
uint32_t timeout_msec)
721721
{
722722
future_t *future = future_new (future_value_ssize_t_type,
723723
4);
724724

725-
future_value_set_mongoc_gridfs_file_t_ptr (
725+
future_value_set_mongoc_gridfs_file_ptr (
726726
future_get_param (future, 0), file);
727727

728-
future_value_set_mongoc_iovec_t_ptr (
728+
future_value_set_mongoc_iovec_ptr (
729729
future_get_param (future, 1), iov);
730730

731731
future_value_set_size_t (

tests/mock_server/future-functions.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ future_database_get_collection_names (
127127
future_t *
128128
future_gridfs_file_readv (
129129

130-
mongoc_gridfs_file_t_ptr file,
131-
mongoc_iovec_t_ptr iov,
130+
mongoc_gridfs_file_ptr file,
131+
mongoc_iovec_ptr iov,
132132
size_t iovcnt,
133133
size_t min_bytes,
134134
uint32_t timeout_msec
@@ -138,7 +138,7 @@ future_gridfs_file_readv (
138138
future_t *
139139
future_gridfs_file_seek (
140140

141-
mongoc_gridfs_file_t_ptr file,
141+
mongoc_gridfs_file_ptr file,
142142
int64_t delta,
143143
int whence
144144
);
@@ -147,8 +147,8 @@ future_gridfs_file_seek (
147147
future_t *
148148
future_gridfs_file_writev (
149149

150-
mongoc_gridfs_file_t_ptr file,
151-
mongoc_iovec_t_ptr iov,
150+
mongoc_gridfs_file_ptr file,
151+
mongoc_iovec_ptr iov,
152152
size_t iovcnt,
153153
uint32_t timeout_msec
154154
);

tests/mock_server/future-value.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,17 @@ future_value_get_mongoc_database_ptr (future_value_t *future_value)
280280
}
281281

282282
void
283-
future_value_set_mongoc_gridfs_file_t_ptr(future_value_t *future_value, mongoc_gridfs_file_t_ptr value)
283+
future_value_set_mongoc_gridfs_file_ptr(future_value_t *future_value, mongoc_gridfs_file_ptr value)
284284
{
285-
future_value->type = future_value_mongoc_gridfs_file_t_ptr_type;
286-
future_value->mongoc_gridfs_file_t_ptr_value = value;
285+
future_value->type = future_value_mongoc_gridfs_file_ptr_type;
286+
future_value->mongoc_gridfs_file_ptr_value = value;
287287
}
288288

289-
mongoc_gridfs_file_t_ptr
290-
future_value_get_mongoc_gridfs_file_t_ptr (future_value_t *future_value)
289+
mongoc_gridfs_file_ptr
290+
future_value_get_mongoc_gridfs_file_ptr (future_value_t *future_value)
291291
{
292-
assert (future_value->type == future_value_mongoc_gridfs_file_t_ptr_type);
293-
return future_value->mongoc_gridfs_file_t_ptr_value;
292+
assert (future_value->type == future_value_mongoc_gridfs_file_ptr_type);
293+
return future_value->mongoc_gridfs_file_ptr_value;
294294
}
295295

296296
void
@@ -322,17 +322,17 @@ future_value_get_mongoc_insert_flags_t (future_value_t *future_value)
322322
}
323323

324324
void
325-
future_value_set_mongoc_iovec_t_ptr(future_value_t *future_value, mongoc_iovec_t_ptr value)
325+
future_value_set_mongoc_iovec_ptr(future_value_t *future_value, mongoc_iovec_ptr value)
326326
{
327-
future_value->type = future_value_mongoc_iovec_t_ptr_type;
328-
future_value->mongoc_iovec_t_ptr_value = value;
327+
future_value->type = future_value_mongoc_iovec_ptr_type;
328+
future_value->mongoc_iovec_ptr_value = value;
329329
}
330330

331-
mongoc_iovec_t_ptr
332-
future_value_get_mongoc_iovec_t_ptr (future_value_t *future_value)
331+
mongoc_iovec_ptr
332+
future_value_get_mongoc_iovec_ptr (future_value_t *future_value)
333333
{
334-
assert (future_value->type == future_value_mongoc_iovec_t_ptr_type);
335-
return future_value->mongoc_iovec_t_ptr_value;
334+
assert (future_value->type == future_value_mongoc_iovec_ptr_type);
335+
return future_value->mongoc_iovec_ptr_value;
336336
}
337337

338338
void

tests/mock_server/future-value.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ typedef mongoc_client_t * mongoc_client_ptr;
3030
typedef mongoc_collection_t * mongoc_collection_ptr;
3131
typedef mongoc_cursor_t * mongoc_cursor_ptr;
3232
typedef mongoc_database_t * mongoc_database_ptr;
33-
typedef mongoc_gridfs_file_t * mongoc_gridfs_file_t_ptr;
33+
typedef mongoc_gridfs_file_t * mongoc_gridfs_file_ptr;
3434
typedef mongoc_gridfs_t * mongoc_gridfs_ptr;
35-
typedef mongoc_iovec_t * mongoc_iovec_t_ptr;
35+
typedef mongoc_iovec_t * mongoc_iovec_ptr;
3636
typedef mongoc_server_description_t * mongoc_server_description_ptr;
3737
typedef mongoc_topology_t * mongoc_topology_ptr;
3838
typedef const mongoc_find_and_modify_opts_t * const_mongoc_find_and_modify_opts_ptr;
@@ -59,10 +59,10 @@ typedef enum {
5959
future_value_mongoc_collection_ptr_type,
6060
future_value_mongoc_cursor_ptr_type,
6161
future_value_mongoc_database_ptr_type,
62-
future_value_mongoc_gridfs_file_t_ptr_type,
62+
future_value_mongoc_gridfs_file_ptr_type,
6363
future_value_mongoc_gridfs_ptr_type,
6464
future_value_mongoc_insert_flags_t_type,
65-
future_value_mongoc_iovec_t_ptr_type,
65+
future_value_mongoc_iovec_ptr_type,
6666
future_value_mongoc_query_flags_t_type,
6767
future_value_mongoc_server_description_ptr_type,
6868
future_value_mongoc_ss_optype_t_type,
@@ -96,10 +96,10 @@ typedef struct _future_value_t
9696
mongoc_collection_ptr mongoc_collection_ptr_value;
9797
mongoc_cursor_ptr mongoc_cursor_ptr_value;
9898
mongoc_database_ptr mongoc_database_ptr_value;
99-
mongoc_gridfs_file_t_ptr mongoc_gridfs_file_t_ptr_value;
99+
mongoc_gridfs_file_ptr mongoc_gridfs_file_ptr_value;
100100
mongoc_gridfs_ptr mongoc_gridfs_ptr_value;
101101
mongoc_insert_flags_t mongoc_insert_flags_t_value;
102-
mongoc_iovec_t_ptr mongoc_iovec_t_ptr_value;
102+
mongoc_iovec_ptr mongoc_iovec_ptr_value;
103103
mongoc_query_flags_t mongoc_query_flags_t_value;
104104
mongoc_server_description_ptr mongoc_server_description_ptr_value;
105105
mongoc_ss_optype_t mongoc_ss_optype_t_value;
@@ -286,12 +286,12 @@ future_value_get_mongoc_database_ptr (
286286
future_value_t *future_value);
287287

288288
void
289-
future_value_set_mongoc_gridfs_file_t_ptr(
289+
future_value_set_mongoc_gridfs_file_ptr(
290290
future_value_t *future_value,
291-
mongoc_gridfs_file_t_ptr value);
291+
mongoc_gridfs_file_ptr value);
292292

293-
mongoc_gridfs_file_t_ptr
294-
future_value_get_mongoc_gridfs_file_t_ptr (
293+
mongoc_gridfs_file_ptr
294+
future_value_get_mongoc_gridfs_file_ptr (
295295
future_value_t *future_value);
296296

297297
void
@@ -313,12 +313,12 @@ future_value_get_mongoc_insert_flags_t (
313313
future_value_t *future_value);
314314

315315
void
316-
future_value_set_mongoc_iovec_t_ptr(
316+
future_value_set_mongoc_iovec_ptr(
317317
future_value_t *future_value,
318-
mongoc_iovec_t_ptr value);
318+
mongoc_iovec_ptr value);
319319

320-
mongoc_iovec_t_ptr
321-
future_value_get_mongoc_iovec_t_ptr (
320+
mongoc_iovec_ptr
321+
future_value_get_mongoc_iovec_ptr (
322322
future_value_t *future_value);
323323

324324
void

tests/mock_server/future.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ future_get_mongoc_database_ptr (future_t *future)
230230
abort ();
231231
}
232232

233-
mongoc_gridfs_file_t_ptr
234-
future_get_mongoc_gridfs_file_t_ptr (future_t *future)
233+
mongoc_gridfs_file_ptr
234+
future_get_mongoc_gridfs_file_ptr (future_t *future)
235235
{
236236
if (future_wait (future)) {
237-
return future_value_get_mongoc_gridfs_file_t_ptr (&future->return_value);
237+
return future_value_get_mongoc_gridfs_file_ptr (&future->return_value);
238238
}
239239

240240
fprintf (stderr, "%s timed out\n", BSON_FUNC);
@@ -263,11 +263,11 @@ future_get_mongoc_insert_flags_t (future_t *future)
263263
abort ();
264264
}
265265

266-
mongoc_iovec_t_ptr
267-
future_get_mongoc_iovec_t_ptr (future_t *future)
266+
mongoc_iovec_ptr
267+
future_get_mongoc_iovec_ptr (future_t *future)
268268
{
269269
if (future_wait (future)) {
270-
return future_value_get_mongoc_iovec_t_ptr (&future->return_value);
270+
return future_value_get_mongoc_iovec_ptr (&future->return_value);
271271
}
272272

273273
fprintf (stderr, "%s timed out\n", BSON_FUNC);

tests/mock_server/future.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ future_get_mongoc_cursor_ptr (future_t *future);
9494
mongoc_database_ptr
9595
future_get_mongoc_database_ptr (future_t *future);
9696

97-
mongoc_gridfs_file_t_ptr
98-
future_get_mongoc_gridfs_file_t_ptr (future_t *future);
97+
mongoc_gridfs_file_ptr
98+
future_get_mongoc_gridfs_file_ptr (future_t *future);
9999

100100
mongoc_gridfs_ptr
101101
future_get_mongoc_gridfs_ptr (future_t *future);
102102

103103
mongoc_insert_flags_t
104104
future_get_mongoc_insert_flags_t (future_t *future);
105105

106-
mongoc_iovec_t_ptr
107-
future_get_mongoc_iovec_t_ptr (future_t *future);
106+
mongoc_iovec_ptr
107+
future_get_mongoc_iovec_ptr (future_t *future);
108108

109109
mongoc_query_flags_t
110110
future_get_mongoc_query_flags_t (future_t *future);

0 commit comments

Comments
 (0)