All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_operations.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2023 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 #pragma once
18 
19 #include <aerospike/as_bin.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /******************************************************************************
26  * TYPES
27  *****************************************************************************/
28 
29 /**
30  * Operation Identifiers
31  */
32 typedef enum as_operator_e {
50 } as_operator;
51 
52 /**
53  * Operation on a bin.
54  * The value for the bin will be applied according to the operation.
55  */
56 typedef struct as_binop_s {
57 
58  /**
59  * The operation to be performed on the bin.
60  */
62 
63  /**
64  * The bin the operation will be performed on.
65  */
67 
68 } as_binop;
69 
70 /**
71  * Sequence of operations.
72  *
73  * ~~~~~~~~~~{.c}
74  * as_operations ops;
75  * as_operations_inita(&ops, 2);
76  * as_operations_add_incr(&ops, "bin1", 123);
77  * as_operations_add_append_str(&ops, "bin2", "abc");
78  * ...
79  * as_operations_destroy(&ops);
80  * ~~~~~~~~~~
81  */
82 typedef struct as_binops_s {
83 
84  /**
85  * Sequence of entries
86  */
88 
89  /**
90  * Number of entries allocated
91  */
92  uint16_t capacity;
93 
94  /**
95  * Number of entries used
96  */
97  uint16_t size;
98 
99  /**
100  * @private
101  * If true, then as_binops_destroy() will free the entries.
102  */
103  bool _free;
104 
105 } as_binops;
106 
107 /**
108  * The `aerospike_key_operate()` function provides the ability to execute
109  * multiple operations on a record in the database as a single atomic
110  * transaction.
111  *
112  * The `as_operations` object is used to define the operations to be performed
113  * on the record.
114  *
115  * ## Initialization
116  *
117  * Before using as_operations, you must first initialize it via either:
118  * - as_operations_inita()
119  * - as_operations_init()
120  * - as_operations_new()
121  *
122  * as_operations_inita() is a macro that initializes a stack allocated
123  * as_operations and allocates an internal array of operations. The macro
124  * accepts a pointer to the stack allocated as_operations and the number of
125  * operations to be added.
126  *
127  * ~~~~~~~~~~{.c}
128  * as_operations ops;
129  * as_operations_inita(&ops, 2);
130  * ~~~~~~~~~~
131  *
132  * as_operations_init() is a function that initializes a stack allocated
133  * as_operations. It differes from as_operations_inita() in that it allocates
134  * the internal array of operations on the heap. It accepts a pointer to the
135  * stack allocated as_operations and the number of operations to be added.
136  *
137  * ~~~~~~~~~~{.c}
138  * as_operations ops;
139  * as_operations_init(&ops, 2);
140  * ~~~~~~~~~~
141  *
142  * as_operations_new() is a function that will allocate a new as_operations
143  * on the heap. It will also allocate the internal array of operation on the
144  * heap.
145  *
146  * ~~~~~~~~~~{.c}
147  * as_operations* ops = as_operations_new(2);
148  * ~~~~~~~~~~
149  *
150  * When you no longer need the as_operations, you can release the resources
151  * allocated to it via as_operations_destroy().
152  *
153  * ## Destruction
154  *
155  * When you no longer require an as_operations, you should call
156  * `as_operations_destroy()` to release it and associated resources.
157  *
158  * ~~~~~~~~~~{.c}
159  * as_operations_destroy(ops);
160  * ~~~~~~~~~~
161  *
162  * ## Usage
163  *
164  * as_operations is a sequence of operations to be applied to a record.
165  *
166  * Each of the following operations is added to the end of the sequence
167  * of operations.
168  *
169  * When you have compiled the sequence of operations you want to execute,
170  * then you will send it to aerospike_key_operate().
171  *
172  * ### Modifying a String
173  *
174  * Aerospike allows you to append a string to a bin containing
175  * a string.
176  *
177  * The following appends a "abc" to bin "bin1".
178  *
179  * ~~~~~~~~~~{.c}
180  * as_operations_add_append_str(ops, "bin1", "abc");
181  * ~~~~~~~~~~
182  *
183  * There is also a prepend operation, which will add the string
184  * to the beginning of the bin's current value.
185  *
186  * ~~~~~~~~~~{.c}
187  * as_operations_add_prepend_str(ops, "bin1", "abc");
188  * ~~~~~~~~~~
189  *
190  * ### Modifying a Byte Array
191  *
192  * Aerospike allows you to append a byte array to a bin containing
193  * a byte array.
194  *
195  * The following appends a 4 byte sequence to bin "bin1".
196  *
197  * ~~~~~~~~~~{.c}
198  * uint8_t raw[4] = { 1, 2, 3, 4 };
199  * as_operations_add_append_raw(ops, "bin1", raw, 4);
200  * ~~~~~~~~~~
201  *
202  * There is also a prepend operation, which will add the bytes
203  * to the beginning of the bin's current value.
204  *
205  * ~~~~~~~~~~{.c}
206  * uint8_t raw[4] = { 1, 2, 3, 4 };
207  * as_operations_add_prepend_raw(ops, "bin1", raw, 4);
208  * ~~~~~~~~~~
209  *
210  * ### Increment an Integer
211  *
212  * Aerospike allows you to increment the value of a bin
213  *
214  * The following increments the value in bin "bin1" by 4.
215  *
216  * ~~~~~~~~~~{.c}
217  * as_operations_add_incr(ops, "bin1", 4);
218  * ~~~~~~~~~~
219  *
220  * ### Write a Value
221  *
222  * Write a value into a bin. Overwriting previous value.
223  *
224  * The following writes a string "xyz" to "bin1".
225  *
226  * ~~~~~~~~~~{.c}
227  * as_operations_add_write_str(ops, "bin1", "xyz");
228  * ~~~~~~~~~~
229  *
230  * ### Read a Value
231  *
232  * Read a value from a bin. This is ideal, if you performed an
233  * operation on a bin, and want to read the new value.
234  *
235  * The following reads the value of "bin1"
236  *
237  * ~~~~~~~~~~{.c}
238  * as_operations_add_read(ops, "bin1");
239  * ~~~~~~~~~~
240  *
241  * ### Touch a Record
242  *
243  * Touching a record will refresh its ttl and increment the generation
244  * of the record.
245  *
246  * The following touches a record.
247  *
248  * ~~~~~~~~~~{.c}
249  * as_operations_add_touch(ops);
250  * ~~~~~~~~~~
251  *
252  * @ingroup client_objects
253  */
254 typedef struct as_operations_s {
255 
256  /**
257  * Operations to be performed on the bins of a record.
258  */
260 
261  /**
262  * The time-to-live (expiration) of the record in seconds.
263  *
264  * There are also special values that can be set in the record ttl:
265  * <ul>
266  * <li>AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.</li>
267  * <li>AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.</li>
268  * <li>AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.</li>
269  * <li>AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_operate.</li>
270  * </ul>
271  */
272  uint32_t ttl;
273 
274  /**
275  * The generation of the record.
276  */
277  uint16_t gen;
278 
279  /**
280  * @private
281  * If true, then as_operations_destroy() will free this instance.
282  */
283  bool _free;
284 
285 } as_operations;
286 
287 /******************************************************************************
288  * MACROS
289  *****************************************************************************/
290 
291 /**
292  * Initializes a stack allocated `as_operations` (as_operations) and allocates
293  * `__nops` number of entries on the stack.
294  *
295  * ~~~~~~~~~~{.c}
296  * as_operations ops;
297  * as_operations_inita(&ops, 2);
298  * as_operations_add_incr(&ops, "bin1", 123);
299  * as_operations_add_append_str(&ops, "bin2", "abc");
300  * ~~~~~~~~~~
301  *
302  * @param __ops The `as_operations *` to initialize.
303  * @param __nops The number of `as_binops.entries` to allocate on the
304  * stack.
305  *
306  * @relates as_operations
307  * @ingroup as_operations_object
308  */
309 #define as_operations_inita(__ops, __nops) \
310  (__ops)->binops.entries = (as_binop*) alloca(sizeof(as_binop) * (__nops));\
311  (__ops)->binops.capacity = (__nops);\
312  (__ops)->binops.size = 0;\
313  (__ops)->binops._free = false;\
314  (__ops)->ttl = 0;\
315  (__ops)->gen = 0;\
316  (__ops)->_free = false;
317 
318 /******************************************************************************
319  * FUNCTIONS
320  *****************************************************************************/
321 
322 /**
323  * Intializes a stack allocated `as_operations`.
324  *
325  * ~~~~~~~~~~{.c}
326  * as_operations ops;
327  * as_operations_init(&ops, 2);
328  * as_operations_add_incr(&ops, "bin1", 123);
329  * as_operations_add_append_str(&ops, "bin2", "abc");
330  * ~~~~~~~~~~
331  *
332  * Use `as_operations_destroy()` to free the resources allocated to the
333  * `as_operations`.
334  *
335  * @param ops The `as_operations` to initialize.
336  * @param nops The number of `as_operations.binops.entries` to allocate on the heap.
337  *
338  * @return The initialized `as_operations` on success. Otherwise NULL.
339  *
340  * @relates as_operations
341  * @ingroup as_operations_object
342  */
344 as_operations_init(as_operations* ops, uint16_t nops);
345 
346 /**
347  * Create and initialize a heap allocated `as_operations`.
348  *
349  * ~~~~~~~~~~{.c}
350  * as_operations ops = as_operations_new(2);
351  * as_operations_add_incr(ops, "bin1", 123);
352  * as_operations_add_append_str(ops, "bin2", "abc");
353  * ~~~~~~~~~~
354  *
355  * Use `as_operations_destroy()` to free the resources allocated to the
356  * `as_operations`.
357  *
358  * @param nops The number of `as_operations.binops.entries` to allocate on the heap.
359  *
360  * @return The new `as_operations` on success. Otherwise NULL.
361  *
362  * @relates as_operations
363  * @ingroup as_operations_object
364  */
366 as_operations_new(uint16_t nops);
367 
368 /**
369  * Destroy an `as_operations` and release associated resources.
370  *
371  * ~~~~~~~~~~{.c}
372  * as_operations_destroy(binops);
373  * ~~~~~~~~~~
374  *
375  * @param ops The `as_operations` to destroy.
376  *
377  * @relates as_operations
378  * @ingroup as_operations_object
379  */
380 AS_EXTERN void
382 
383 /**
384  * Add a `AS_OPERATOR_WRITE` bin operation.
385  *
386  * @param ops The `as_operations` to append the operation to.
387  * @param name The name of the bin to perform the operation on.
388  * @param value The value to be used in the operation.
389  *
390  * @return true on success. Otherwise an error occurred.
391  *
392  * @relates as_operations
393  * @ingroup as_operations_object
394  */
395 AS_EXTERN bool
396 as_operations_add_write(as_operations* ops, const char* name, as_bin_value* value);
397 
398 /**
399  * Add a `AS_OPERATOR_WRITE` bin operation with an bool value.
400  *
401  * @param ops The `as_operations` to append the operation to.
402  * @param name The name of the bin to perform the operation on.
403  * @param value The value to be used in the operation.
404  *
405  * @return true on success. Otherwise an error occurred.
406  *
407  * @relates as_operations
408  * @ingroup as_operations_object
409  */
410 AS_EXTERN bool
411 as_operations_add_write_bool(as_operations* ops, const char* name, bool value);
412 
413 /**
414  * Add a `AS_OPERATOR_WRITE` bin operation with an int64_t value.
415  *
416  * @param ops The `as_operations` to append the operation to.
417  * @param name The name of the bin to perform the operation on.
418  * @param value The value to be used in the operation.
419  *
420  * @return true on success. Otherwise an error occurred.
421  *
422  * @relates as_operations
423  * @ingroup as_operations_object
424  */
425 AS_EXTERN bool
426 as_operations_add_write_int64(as_operations* ops, const char* name, int64_t value);
427 
428 /**
429  * Add a `AS_OPERATOR_WRITE` bin operation with a double value.
430  *
431  * @param ops The `as_operations` to append the operation to.
432  * @param name The name of the bin to perform the operation on.
433  * @param value The value to be used in the operation.
434  *
435  * @return true on success. Otherwise an error occurred.
436  *
437  * @relates as_operations
438  * @ingroup as_operations_object
439  */
440 AS_EXTERN bool
441 as_operations_add_write_double(as_operations* ops, const char* name, double value);
442 
443 /**
444  * Add a `AS_OPERATOR_WRITE` bin operation with a NULL-terminated string value.
445  *
446  * @param ops The `as_operations` to append the operation to.
447  * @param name The name of the bin to perform the operation on.
448  * @param value The value to be used in the operation.
449  * @param free If true, then the value will be freed when the operations is destroyed.
450  *
451  * @return true on success. Otherwise an error occurred.
452  *
453  * @relates as_operations
454  * @ingroup as_operations_object
455  */
456 AS_EXTERN bool
457 as_operations_add_write_strp(as_operations* ops, const char* name, const char* value, bool free);
458 
459 /**
460  * Add a `AS_OPERATOR_WRITE` bin operation with a NULL-terminated string value.
461  *
462  * @param ops The `as_operations` to append the operation to.
463  * @param name The name of the bin to perform the operation on.
464  * @param value The value to be used in the operation. Must last for the lifetime of the operations.
465  *
466  * @return true on success. Otherwise an error occurred.
467  *
468  * @relates as_operations
469  * @ingroup as_operations_object
470  */
471 static inline bool
472 as_operations_add_write_str(as_operations* ops, const char* name, const char* value)
473 {
474  return as_operations_add_write_strp(ops, name, value, false);
475 }
476 
477 /**
478  * Add a `AS_OPERATOR_WRITE` bin operation with a NULL-terminated GeoJSON string value.
479  *
480  * @param ops The `as_operations` to append the operation to.
481  * @param name The name of the bin to perform the operation on.
482  * @param value The value to be used in the operation.
483  * @param free If true, then the value will be freed when the operations is destroyed.
484  *
485  * @return true on success. Otherwise an error occurred.
486  *
487  * @relates as_operations
488  * @ingroup as_operations_object
489  */
490 AS_EXTERN bool
491 as_operations_add_write_geojson_strp(as_operations* ops, const char* name, const char* value, bool free);
492 
493 /**
494  * Add a `AS_OPERATOR_WRITE` bin operation with a NULL-terminated GeoJSON string value.
495  *
496  * @param ops The `as_operations` to append the operation to.
497  * @param name The name of the bin to perform the operation on.
498  * @param value The value to be used in the operation. Must last for the lifetime of the operations.
499  *
500  * @return true on success. Otherwise an error occurred.
501  *
502  * @relates as_operations
503  * @ingroup as_operations_object
504  */
505 static inline bool
506 as_operations_add_write_geojson_str(as_operations* ops, const char* name, const char* value)
507 {
508  return as_operations_add_write_geojson_strp(ops, name, value, false);
509 }
510 
511 /**
512  * Add a `AS_OPERATOR_WRITE` bin operation with a raw bytes value.
513  *
514  * @param ops The `as_operations` to append the operation to.
515  * @param name The name of the bin to perform the operation on.
516  * @param value The value to be used in the operation.
517  * @param size The size of the value.
518  * @param free If true, then the value will be freed when the operations is destroyed.
519  *
520  * @return true on success. Otherwise an error occurred.
521  *
522  * @relates as_operations
523  * @ingroup as_operations_object
524  */
525 AS_EXTERN bool
526 as_operations_add_write_rawp(as_operations* ops, const char* name, const uint8_t* value, uint32_t size, bool free);
527 
528 /**
529  * Add a `AS_OPERATOR_WRITE` bin operation with a raw bytes value.
530  *
531  * @param ops The `as_operations` to append the operation to.
532  * @param name The name of the bin to perform the operation on.
533  * @param value The value to be used in the operation.
534  * @param size The size of the value. Must last for the lifetime of the operations.
535  *
536  * @return true on success. Otherwise an error occurred.
537  *
538  * @relates as_operations
539  * @ingroup as_operations_object
540  */
541 static inline bool
542 as_operations_add_write_raw(as_operations* ops, const char* name, const uint8_t* value, uint32_t size)
543 {
544  return as_operations_add_write_rawp(ops, name, value, size, false);
545 }
546 
547 /**
548  * Add a `AS_OPERATOR_READ` bin operation.
549  *
550  * @param ops The `as_operations` to append the operation to.
551  * @param name The name of the bin to perform the operation on.
552  *
553  * @return true on success. Otherwise an error occurred.
554  *
555  * @relates as_operations
556  * @ingroup as_operations_object
557  */
558 AS_EXTERN bool
559 as_operations_add_read(as_operations* ops, const char* name);
560 
561 /**
562  * Create read all bins database operation.
563  *
564  * @param ops The `as_operations` to append the operation to.
565  *
566  * @return true on success. Otherwise an error occurred.
567  *
568  * @relates as_operations
569  * @ingroup as_operations_object
570  */
571 AS_EXTERN bool
573 
574 /**
575  * Add a `AS_OPERATOR_INCR` bin operation with (required) int64_t value.
576  *
577  * @param ops The `as_operations` to append the operation to.
578  * @param name The name of the bin to perform the operation on.
579  * @param value The value to be used in the operation.
580  *
581  * @return true on success. Otherwise an error occurred.
582  *
583  * @relates as_operations
584  * @ingroup as_operations_object
585  */
586 AS_EXTERN bool
587 as_operations_add_incr(as_operations* ops, const char* name, int64_t value);
588 
589 /**
590  * Add a `AS_OPERATOR_INCR` bin operation with double value.
591  *
592  * @param ops The `as_operations` to append the operation to.
593  * @param name The name of the bin to perform the operation on.
594  * @param value The value to be used in the operation.
595  *
596  * @return true on success. Otherwise an error occurred.
597  *
598  * @relates as_operations
599  * @ingroup as_operations_object
600  */
601 AS_EXTERN bool
602 as_operations_add_incr_double(as_operations* ops, const char* name, double value);
603 
604 /**
605  * Add a `AS_OPERATOR_PREPEND` bin operation with a NULL-terminated string value.
606  *
607  * @param ops The `as_operations` to append the operation to.
608  * @param name The name of the bin to perform the operation on.
609  * @param value The value to be used in the operation.
610  * @param free If true, then the value will be freed when the operations is destroyed.
611  *
612  * @return true on success. Otherwise an error occurred.
613  *
614  * @relates as_operations
615  * @ingroup as_operations_object
616  */
617 AS_EXTERN bool
618 as_operations_add_prepend_strp(as_operations* ops, const char* name, const char* value, bool free);
619 
620 /**
621  * Add a `AS_OPERATOR_PREPEND` bin operation with a NULL-terminated string value.
622  *
623  * @param ops The `as_operations` to append the operation to.
624  * @param name The name of the bin to perform the operation on.
625  * @param value The value to be used in the operation. Must last for the lifetime of the operations.
626  *
627  * @return true on success. Otherwise an error occurred.
628  *
629  * @relates as_operations
630  * @ingroup as_operations_object
631  */
632 static inline bool
633 as_operations_add_prepend_str(as_operations* ops, const char* name, const char* value)
634 {
635  return as_operations_add_prepend_strp(ops, name, value, false);
636 }
637 
638 /**
639  * Add a `AS_OPERATOR_PREPEND` bin operation with a raw bytes value.
640  *
641  * @param ops The `as_operations` to append the operation to.
642  * @param name The name of the bin to perform the operation on.
643  * @param value The value to be used in the operation.
644  * @param size The size of the value.
645  * @param free If true, then the value will be freed when the operations is destroyed.
646  *
647  * @return true on success. Otherwise an error occurred.
648  *
649  * @relates as_operations
650  * @ingroup as_operations_object
651  */
652 AS_EXTERN bool
653 as_operations_add_prepend_rawp(as_operations* ops, const char* name, const uint8_t* value, uint32_t size, bool free);
654 
655 /**
656  * Add a `AS_OPERATOR_PREPEND` bin operation with a raw bytes value.
657  *
658  * @param ops The `as_operations` to append the operation to.
659  * @param name The name of the bin to perform the operation on.
660  * @param value The value to be used in the operation. Must last for the lifetime of the operations.
661  * @param size The size of the value.
662  *
663  * @return true on success. Otherwise an error occurred.
664  *
665  * @relates as_operations
666  * @ingroup as_operations_object
667  */
668 static inline bool
669 as_operations_add_prepend_raw(as_operations* ops, const char* name, const uint8_t* value, uint32_t size)
670 {
671  return as_operations_add_prepend_rawp(ops, name, value, size, false);
672 }
673 
674 /**
675  * Add a `AS_OPERATOR_APPEND` bin operation with a NULL-terminated string value.
676  *
677  * @param ops The `as_operations` to append the operation to.
678  * @param name The name of the bin to perform the operation on.
679  * @param value The value to be used in the operation.
680  * @param free If true, then the value will be freed when the operations is destroyed.
681  *
682  * @return true on success. Otherwise an error occurred.
683  *
684  * @relates as_operations
685  * @ingroup as_operations_object
686  */
687 AS_EXTERN bool
688 as_operations_add_append_strp(as_operations* ops, const char* name, const char* value, bool free);
689 
690 /**
691  * Add a `AS_OPERATOR_APPEND` bin operation with a NULL-terminated string value.
692  *
693  * @param ops The `as_operations` to append the operation to.
694  * @param name The name of the bin to perform the operation on.
695  * @param value The value to be used in the operation. Must last for the lifetime of the operations.
696  *
697  * @return true on success. Otherwise an error occurred.
698  *
699  * @relates as_operations
700  * @ingroup as_operations_object
701  */
702 static inline bool
703 as_operations_add_append_str(as_operations* ops, const char* name, const char* value)
704 {
705  return as_operations_add_append_strp(ops, name, value, false);
706 }
707 
708 /**
709  * Add a `AS_OPERATOR_APPEND` bin operation with a raw bytes value.
710  *
711  * @param ops The `as_operations` to append the operation to.
712  * @param name The name of the bin to perform the operation on.
713  * @param value The value to be used in the operation.
714  * @param size The size of the value.
715  * @param free If true, then the value will be freed when the operations is destroyed.
716  *
717  * @return true on success. Otherwise an error occurred.
718  *
719  * @relates as_operations
720  * @ingroup as_operations_object
721  */
722 AS_EXTERN bool
723 as_operations_add_append_rawp(as_operations* ops, const char* name, const uint8_t* value, uint32_t size, bool free);
724 
725 /**
726  * Add a `AS_OPERATOR_APPEND` bin operation with a raw bytes value.
727  *
728  * @param ops The `as_operations` to append the operation to.
729  * @param name The name of the bin to perform the operation on.
730  * @param value The value to be used in the operation. Must last for the lifetime of the operations.
731  * @param size The size of the value.
732  *
733  * @return true on success. Otherwise an error occurred.
734  *
735  * @relates as_operations
736  * @ingroup as_operations_object
737  */
738 static inline bool
739 as_operations_add_append_raw(as_operations* ops, const char* name, const uint8_t* value, uint32_t size)
740 {
741  return as_operations_add_append_rawp(ops, name, value, size, false);
742 }
743 
744 /**
745  * Add a `AS_OPERATOR_TOUCH` record operation.
746  *
747  * @param ops The `as_operations` to append the operation to.
748  *
749  * @return true on success. Otherwise an error occurred.
750  *
751  * @relates as_operations
752  * @ingroup as_operations_object
753  */
754 AS_EXTERN bool
756 
757 /**
758  * Add a `AS_OPERATOR_DELETE` record operation.
759  *
760  * @param ops The `as_operations` to append the operation to.
761  *
762  * @return true on success. Otherwise an error occurred.
763  *
764  * @relates as_operations
765  * @ingroup as_operations_object
766  */
767 AS_EXTERN bool
769 
770 /******************************************************************************
771  * LIST FUNCTIONS
772  *****************************************************************************/
773 
774 // Add list operations to this header file for legacy reasons.
775 
777 
778 #ifdef __cplusplus
779 } // end extern "C"
780 #endif
uint16_t size
Definition: as_operations.h:97
AS_EXTERN void as_operations_destroy(as_operations *ops)
AS_EXTERN bool as_operations_add_write_int64(as_operations *ops, const char *name, int64_t value)
AS_EXTERN bool as_operations_add_prepend_rawp(as_operations *ops, const char *name, const uint8_t *value, uint32_t size, bool free)
as_binop * entries
Definition: as_operations.h:87
AS_EXTERN bool as_operations_add_touch(as_operations *ops)
AS_EXTERN bool as_operations_add_write_strp(as_operations *ops, const char *name, const char *value, bool free)
static bool as_operations_add_prepend_raw(as_operations *ops, const char *name, const uint8_t *value, uint32_t size)
AS_EXTERN bool as_operations_add_append_strp(as_operations *ops, const char *name, const char *value, bool free)
AS_EXTERN bool as_operations_add_prepend_strp(as_operations *ops, const char *name, const char *value, bool free)
Definition: as_bin.h:79
AS_EXTERN bool as_operations_add_write_geojson_strp(as_operations *ops, const char *name, const char *value, bool free)
static bool as_operations_add_append_str(as_operations *ops, const char *name, const char *value)
#define AS_EXTERN
Definition: as_std.h:25
AS_EXTERN as_operations * as_operations_new(uint16_t nops)
as_operator
Definition: as_operations.h:32
uint16_t capacity
Definition: as_operations.h:92
as_bin bin
Definition: as_operations.h:66
AS_EXTERN bool as_operations_add_write_bool(as_operations *ops, const char *name, bool value)
AS_EXTERN bool as_operations_add_read_all(as_operations *ops)
as_binops binops
static bool as_operations_add_write_str(as_operations *ops, const char *name, const char *value)
AS_EXTERN bool as_operations_add_append_rawp(as_operations *ops, const char *name, const uint8_t *value, uint32_t size, bool free)
AS_EXTERN bool as_operations_add_delete(as_operations *ops)
static bool as_operations_add_write_raw(as_operations *ops, const char *name, const uint8_t *value, uint32_t size)
AS_EXTERN bool as_operations_add_incr_double(as_operations *ops, const char *name, double value)
AS_EXTERN bool as_operations_add_write(as_operations *ops, const char *name, as_bin_value *value)
static bool as_operations_add_write_geojson_str(as_operations *ops, const char *name, const char *value)
static bool as_operations_add_append_raw(as_operations *ops, const char *name, const uint8_t *value, uint32_t size)
static bool as_operations_add_prepend_str(as_operations *ops, const char *name, const char *value)
AS_EXTERN bool as_operations_add_write_rawp(as_operations *ops, const char *name, const uint8_t *value, uint32_t size, bool free)
as_operator op
Definition: as_operations.h:61
AS_EXTERN as_operations * as_operations_init(as_operations *ops, uint16_t nops)
AS_EXTERN bool as_operations_add_incr(as_operations *ops, const char *name, int64_t value)
AS_EXTERN bool as_operations_add_write_double(as_operations *ops, const char *name, double value)
AS_EXTERN bool as_operations_add_read(as_operations *ops, const char *name)