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