Loading...
Searching...
No Matches
as_bit_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 bit_operations Bit Operations
21 * @ingroup client_operations
22 *
23 * Bit operations. Create bit operations used in aerospike_key_operate().
24 * Offset orientation is left-to-right. Negative offsets are supported.
25 * If the offset is negative, the offset starts backwards from end of the bitmap.
26 * If an offset is out of bounds, a parameter error will be returned.
27 *
28 * Code examples:
29 *
30 * ~~~~~~~~~~{.c}
31 * // Set bitmap bin.
32 * as_operations ops;
33 * as_operations_inita(&ops, 1);
34 * uint8_t val[] = {0x11, 0x22, 0x33, 0x44};
35 * as_operations_bit_set(&ops, "bin", NULL, NULL, 0, 32, sizeof(val), val);
36 *
37 * as_record* rec = NULL;
38 * as_error err;
39 * aerospike_key_operate(&as, &err, NULL, &key, &ops, &rec);
40 * as_operations_destroy(&ops);
41 * as_record_destroy(rec);
42 * ~~~~~~~~~~
43 *
44 * Bit operations on bitmap items nested in lists/maps are not currently
45 * supported by the server. The as_cdt_ctx argument in bit operations must
46 * be set to NULL.
47 */
48
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/******************************************************************************
56 * TYPES
57 *****************************************************************************/
58
59/**
60 * Bitmap write flags.
61 *
62 * @ingroup bit_operations
63 */
64typedef enum as_bit_write_flags_e {
65 /**
66 * Default. Allow create or update.
67 */
69
70 /**
71 * If the bin already exists, the operation will be denied.
72 * If the bin does not exist, a new bin will be created.
73 */
75
76 /**
77 * If the bin already exists, the bin will be overwritten.
78 * If the bin does not exist, the operation will be denied.
79 */
81
82 /**
83 * Do not raise error if operation is denied.
84 */
86
87 /**
88 * Don't fail if the bit operation would increase the blob size.
89 * Instead, apply the bit operation without increasing the blob size.
90 */
93
94/**
95 * Bitmap resize flags.
96 *
97 * @ingroup bit_operations
98 */
99typedef enum as_bit_resize_flags_e {
100 /**
101 * Default.
102 */
104
105 /**
106 * Add/remove bytes from the beginning instead of the end.
107 */
109
110 /**
111 * Only allow the bitmap size to increase.
112 */
114
115 /**
116 * Only allow the bitmap size to decrease.
117 */
120
121/**
122 * Action to take when bitwise add/subtract results in overflow/underflow.
123 *
124 * @ingroup bit_operations
125 */
126typedef enum as_bit_overflow_action_e {
127 /**
128 * Fail operation with error.
129 */
131
132 /**
133 * If add/subtract overflows/underflows, set to max/min value.
134 * Example: MAXINT + 1 = MAXINT
135 */
137
138 /**
139 * If add/subtract overflows/underflows, wrap the value.
140 * Example: MAXINT + 1 = -1
141 */
144
145/**
146 * Bit operation policy.
147 *
148 * @ingroup bit_operations
149 */
150typedef struct as_bit_policy_s {
151 uint64_t flags;
153
154/**
155 * @private
156 * Bit operation codes.
157 */
178
179/******************************************************************************
180 * PRIVATE FUNCTIONS
181 *****************************************************************************/
182
183AS_EXTERN bool
185 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
186 uint16_t command, int offset, uint32_t size
187 );
188
189AS_EXTERN bool
191 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
192 uint16_t command, int bit_offset, uint32_t bit_size, uint32_t shift
193 );
194
195AS_EXTERN bool
197 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
198 uint16_t command, int bit_offset, uint32_t bit_size, uint64_t value, bool sign,
200 );
201
202AS_EXTERN bool
204 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
205 uint16_t command, int bit_offset, uint32_t bit_size, uint32_t value_size, uint8_t* value
206 );
207
208AS_EXTERN bool
210 as_operations* ops, const char* name, as_cdt_ctx* ctx, uint16_t command, int bit_offset,
211 uint32_t bit_size
212 );
213
214AS_EXTERN bool
216 as_operations* ops, const char* name, as_cdt_ctx* ctx, uint16_t command, int bit_offset,
217 uint32_t bit_size, bool value
218 );
219
220/******************************************************************************
221 * PUBLIC FUNCTIONS
222 *****************************************************************************/
223
224/**
225 * Initialize bit policy to default.
226 *
227 * @ingroup bit_operations
228 */
229static inline void
234
235/**
236 * Set bit write flags in bit policy.
237 *
238 * @ingroup bit_operations
239 */
240static inline void
242{
243 policy->flags = flags;
244}
245
246/**
247 * Create byte "resize" operation.
248 * Server resizes bitmap to byte_size according to flags.
249 * Server does not return a value.
250 * Example:
251 * <ul>
252 * <li>bin = [0b00000001, 0b01000010]</li>
253 * <li>byte_size = 4</li>
254 * <li>flags = 0</li>
255 * <li>bin result = [0b00000001, 0b01000010, 0b00000000, 0b00000000]</li>
256 * </ul>
257 *
258 * @ingroup bit_operations
259 */
260AS_EXTERN bool
262 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
263 uint32_t byte_size, as_bit_resize_flags flags
264 );
265
266/**
267 * Create byte "insert" operation.
268 * Server inserts value bytes into bitmap at byte_offset.
269 * Server does not return a value.
270 * Example:
271 * <ul>
272 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
273 * <li>byte_offset = 1</li>
274 * <li>value_byte_size = 2</li>
275 * <li>value = [0b11111111, 0b11000111]</li>
276 * <li>bin result = [0b00000001, 0b11111111, 0b11000111, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
277 * </ul>
278 *
279 * @ingroup bit_operations
280 */
281AS_EXTERN bool
283 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
284 int byte_offset, uint32_t value_byte_size, uint8_t* value
285 );
286
287/**
288 * Create byte "remove" operation.
289 * Server removes bytes from bitmap at byte_offset for byte_size.
290 * Server does not return a value.
291 * Example:
292 * <ul>
293 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
294 * <li>byte_offset = 2</li>
295 * <li>byte_size = 3</li>
296 * <li>bin result = [0b00000001, 0b01000010]</li>
297 * </ul>
298 *
299 * @ingroup bit_operations
300 */
301static inline bool
303 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
304 int byte_offset, uint32_t byte_size
305 )
306{
307 return as_bit_write(ops, name, ctx, policy, AS_BIT_OP_REMOVE, byte_offset, byte_size);
308}
309
310/**
311 * Create bit "set" operation.
312 * Server sets value on bitmap at bit_offset for bit_size.
313 * Server does not return a value.
314 * Example:
315 * <ul>
316 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
317 * <li>bit_offset = 13</li>
318 * <li>bit_size = 3</li>
319 * <li>value_byte_size = 1</li>
320 * <li>value = [0b11100000]</li>
321 * <li>bin result = [0b00000001, 0b01000111, 0b00000011, 0b00000100, 0b00000101]</li>
322 * </ul>
323 *
324 * @ingroup bit_operations
325 */
326static inline bool
328 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
329 int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t* value
330 )
331{
332 return as_bit_byte_math(ops, name, ctx, policy, AS_BIT_OP_SET, bit_offset, bit_size, value_byte_size, value);
333}
334
335/**
336 * Create bit "or" operation.
337 * Server performs bitwise "or" on value and bitmap at bit_offset for bit_size.
338 * Server does not return a value.
339 * Example:
340 * <ul>
341 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
342 * <li>bit_offset = 17</li>
343 * <li>bit_size = 6</li>
344 * <li>value_byte_size = 1</li>
345 * <li>value = [0b10101000]</li>
346 * <li>bin result = [0b00000001, 0b01000010, 0b01010111, 0b00000100, 0b00000101]</li>
347 * </ul>
348 *
349 * @ingroup bit_operations
350 */
351static inline bool
353 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
354 int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t* value
355 )
356{
357 return as_bit_byte_math(ops, name, ctx, policy, AS_BIT_OP_OR, bit_offset, bit_size, value_byte_size, value);
358}
359
360/**
361 * Create bit "exclusive or" operation.
362 * Server performs bitwise "xor" on value and bitmap at bit_offset for bit_size.
363 * Server does not return a value.
364 * Example:
365 * <ul>
366 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
367 * <li>bit_offset = 17</li>
368 * <li>bit_size = 6</li>
369 * <li>value_byte_size = 1</li>
370 * <li>value = [0b10101100]</li>
371 * <li>bin result = [0b00000001, 0b01000010, 0b01010101, 0b00000100, 0b00000101]</li>
372 * </ul>
373 *
374 * @ingroup bit_operations
375 */
376static inline bool
378 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
379 int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t* value
380 )
381{
382 return as_bit_byte_math(ops, name, ctx, policy, AS_BIT_OP_XOR, bit_offset, bit_size, value_byte_size, value);
383}
384
385/**
386 * Create bit "and" operation.
387 * Server performs bitwise "and" on value and bitmap at bit_offset for bit_size.
388 * Server does not return a value.
389 * Example:
390 * <ul>
391 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
392 * <li>bit_offset = 23</li>
393 * <li>bit_size = 9</li>
394 * <li>value_byte_size = 2</li>
395 * <li>value = [0b00111100, 0b10000000]</li>
396 * <li>bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101]</li>
397 * </ul>
398 *
399 * @ingroup bit_operations
400 */
401static inline bool
403 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
404 int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t* value
405 )
406{
407 return as_bit_byte_math(ops, name, ctx, policy, AS_BIT_OP_AND, bit_offset, bit_size, value_byte_size, value);
408}
409
410/**
411 * Create bit "not" operation.
412 * Server negates bitmap starting at bit_offset for bit_size.
413 * Server does not return a value.
414 * Example:
415 * <ul>
416 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
417 * <li>bit_offset = 25</li>
418 * <li>bit_size = 6</li>
419 * <li>bin result = [0b00000001, 0b01000010, 0b00000011, 0b01111010, 0b00000101]</li>
420 * </ul>
421 *
422 * @ingroup bit_operations
423 */
424static inline bool
426 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
427 int bit_offset, uint32_t bit_size
428 )
429{
430 return as_bit_write(ops, name, ctx, policy, AS_BIT_OP_NOT, bit_offset, bit_size);
431}
432
433/**
434 * Create bit "left shift" operation.
435 * Server shifts left bitmap starting at bit_offset for bit_size.
436 * Server does not return a value.
437 * Example:
438 * <ul>
439 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
440 * <li>bit_offset = 32</li>
441 * <li>bit_size = 8</li>
442 * <li>shift = 3</li>
443 * <li>bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00101000]</li>
444 * </ul>
445 *
446 * @ingroup bit_operations
447 */
448static inline bool
450 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
451 int bit_offset, uint32_t bit_size, uint32_t shift
452 )
453{
454 return as_bit_shift(ops, name, ctx, policy, AS_BIT_OP_LSHIFT, bit_offset, bit_size, shift);
455}
456
457/**
458 * Create bit "right shift" operation.
459 * Server shifts right bitmap starting at bit_offset for bit_size.
460 * Server does not return a value.
461 * Example:
462 * <ul>
463 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
464 * <li>bit_offset = 0</li>
465 * <li>bit_size = 9</li>
466 * <li>shift = 1</li>
467 * <li>bin result = [0b00000000, 0b11000010, 0b00000011, 0b00000100, 0b00000101]</li>
468 * </ul>
469 *
470 * @ingroup bit_operations
471 */
472static inline bool
474 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
475 int bit_offset, uint32_t bit_size, uint32_t shift
476 )
477{
478 return as_bit_shift(ops, name, ctx, policy, AS_BIT_OP_RSHIFT, bit_offset, bit_size, shift);
479}
480
481/**
482 * Create bit "add" operation.
483 * Server adds value to bitmap starting at bit_offset for bit_size. bit_size must be <= 64.
484 * Sign indicates if bits should be treated as a signed number.
485 * If add overflows/underflows, as_bit_overflow_action is used.
486 * Server does not return a value.
487 * Example:
488 * <ul>
489 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
490 * <li>bit_offset = 24</li>
491 * <li>bit_size = 16</li>
492 * <li>value = 128</li>
493 * <li>sign = false</li>
494 * <li>bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b10000101]</li>
495 * </ul>
496 *
497 * @ingroup bit_operations
498 */
499static inline bool
501 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
502 int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action
503 )
504{
505 return as_bit_math(ops, name, ctx, policy, AS_BIT_OP_ADD, bit_offset, bit_size, value, sign, action);
506}
507
508/**
509 * Create bit "subtract" operation.
510 * Server subtracts value from bitmap starting at bit_offset for bit_size. bit_size must be <= 64.
511 * Sign indicates if bits should be treated as a signed number.
512 * If add overflows/underflows, as_bit_overflow_action is used.
513 * Server does not return a value.
514 * Example:
515 * <ul>
516 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
517 * <li>bit_offset = 24</li>
518 * <li>bit_size = 16</li>
519 * <li>value = 128</li>
520 * <li>sign = false</li>
521 * <li>bin result = [0b00000001, 0b01000010, 0b00000011, 0b0000011, 0b10000101]</li>
522 * </ul>
523 *
524 * @ingroup bit_operations
525 */
526static inline bool
528 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
529 int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action
530 )
531{
532 return as_bit_math(ops, name, ctx, policy, AS_BIT_OP_SUBTRACT, bit_offset, bit_size, value, sign, action);
533}
534
535/**
536 * Create bit "set integer" operation.
537 * Server sets value to bitmap starting at bit_offset for bit_size. Size must be <= 64.
538 * Server does not return a value.
539 * Example:
540 * <ul>
541 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
542 * <li>bit_offset = 1</li>
543 * <li>bit_size = 8</li>
544 * <li>value = 127</li>
545 * <li>bin result = [0b00111111, 0b11000010, 0b00000011, 0b0000100, 0b00000101]</li>
546 * </ul>
547 *
548 * @ingroup bit_operations
549 */
550AS_EXTERN bool
552 as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
553 int bit_offset, uint32_t bit_size, int64_t value
554 );
555
556/**
557 * Create bit "get" operation.
558 * Server returns bits from bitmap starting at bit_offset for bit_size.
559 * Example:
560 * <ul>
561 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
562 * <li>bit_offset = 9</li>
563 * <li>bit_size = 5</li>
564 * <li>returns [0b10000000]</li>
565 * </ul>
566 *
567 * @ingroup bit_operations
568 */
569static inline bool
571 as_operations* ops, const char* name, as_cdt_ctx* ctx, int bit_offset, uint32_t bit_size
572 )
573{
574 return as_bit_read(ops, name, ctx, AS_BIT_OP_GET, bit_offset, bit_size);
575}
576
577/**
578 * Create bit "count" operation.
579 * Server returns integer count of set bits from bitmap starting at bit_offset for bit_size.
580 * Example:
581 * <ul>
582 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
583 * <li>bit_offset = 20</li>
584 * <li>bit_size = 4</li>
585 * <li>returns 2</li>
586 * </ul>
587 *
588 * @ingroup bit_operations
589 */
590static inline bool
592 as_operations* ops, const char* name, as_cdt_ctx* ctx, int bit_offset, uint32_t bit_size
593 )
594{
595 return as_bit_read(ops, name, ctx, AS_BIT_OP_COUNT, bit_offset, bit_size);
596}
597
598/**
599 * Create bit "left scan" operation.
600 * Server returns integer bit offset of the first specified value bit in bitmap
601 * starting at bit_offset for bit_size.
602 * Example:
603 * <ul>
604 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
605 * <li>bit_offset = 24</li>
606 * <li>bit_size = 8</li>
607 * <li>value = true</li>
608 * <li>returns 5</li>
609 * </ul>
610 *
611 * @ingroup bit_operations
612 */
613static inline bool
615 as_operations* ops, const char* name, as_cdt_ctx* ctx, int bit_offset, uint32_t bit_size,
616 bool value
617 )
618{
619 return as_bit_scan(ops, name, ctx, AS_BIT_OP_LSCAN, bit_offset, bit_size, value);
620}
621
622/**
623 * Create bit "right scan" operation.
624 * Server returns integer bit offset of the last specified value bit in bitmap
625 * starting at bit_offset for bit_size.
626 * Example:
627 * <ul>
628 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
629 * <li>bit_offset = 32</li>
630 * <li>bit_size = 8</li>
631 * <li>value = true</li>
632 * <li>returns 7</li>
633 * </ul>
634 *
635 * @ingroup bit_operations
636 */
637static inline bool
639 as_operations* ops, const char* name, as_cdt_ctx* ctx, int bit_offset, uint32_t bit_size,
640 bool value
641 )
642{
643 return as_bit_scan(ops, name, ctx, AS_BIT_OP_RSCAN, bit_offset, bit_size, value);
644}
645
646/**
647 * Create bit "get integer" operation.
648 * Server returns integer from bitmap starting at bit_offset for bit_size.
649 * Sign indicates if bits should be treated as a signed number.
650 * Example:
651 * <ul>
652 * <li>bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]</li>
653 * <li>bit_offset = 8</li>
654 * <li>bit_size = 16</li>
655 * <li>sign = false</li>
656 * <li>returns 16899</li>
657 * </ul>
658 *
659 * @ingroup bit_operations
660 */
661AS_EXTERN bool
663 as_operations* ops, const char* name, as_cdt_ctx* ctx, int bit_offset, uint32_t bit_size,
664 bool sign
665 );
666
667#ifdef __cplusplus
668} // end extern "C"
669#endif
AS_EXTERN bool as_bit_read(as_operations *ops, const char *name, as_cdt_ctx *ctx, uint16_t command, int bit_offset, uint32_t bit_size)
AS_EXTERN bool as_bit_byte_math(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, uint16_t command, int bit_offset, uint32_t bit_size, uint32_t value_size, uint8_t *value)
@ AS_BIT_OP_SUBTRACT
@ AS_BIT_OP_INSERT
@ AS_BIT_OP_GET
@ AS_BIT_OP_ADD
@ AS_BIT_OP_LSCAN
@ AS_BIT_OP_GET_INT
@ AS_BIT_OP_LSHIFT
@ AS_BIT_OP_XOR
@ AS_BIT_OP_COUNT
@ AS_BIT_OP_AND
@ AS_BIT_OP_OR
@ AS_BIT_OP_SET
@ AS_BIT_OP_RESIZE
@ AS_BIT_OP_RSHIFT
@ AS_BIT_OP_NOT
@ AS_BIT_OP_REMOVE
@ AS_BIT_OP_SET_INT
@ AS_BIT_OP_RSCAN
AS_EXTERN bool as_bit_shift(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, uint16_t command, int bit_offset, uint32_t bit_size, uint32_t shift)
AS_EXTERN bool as_bit_write(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, uint16_t command, int offset, uint32_t size)
AS_EXTERN bool as_bit_math(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, uint16_t command, int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action)
AS_EXTERN bool as_bit_scan(as_operations *ops, const char *name, as_cdt_ctx *ctx, uint16_t command, int bit_offset, uint32_t bit_size, bool value)
#define AS_EXTERN
Definition as_std.h:25
static bool as_operations_bit_remove(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int byte_offset, uint32_t byte_size)
static bool as_operations_bit_lscan(as_operations *ops, const char *name, as_cdt_ctx *ctx, int bit_offset, uint32_t bit_size, bool value)
static void as_bit_policy_set_write_flags(as_bit_policy *policy, as_bit_write_flags flags)
static bool as_operations_bit_and(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t *value)
as_bit_overflow_action
static bool as_operations_bit_rscan(as_operations *ops, const char *name, as_cdt_ctx *ctx, int bit_offset, uint32_t bit_size, bool value)
static bool as_operations_bit_get(as_operations *ops, const char *name, as_cdt_ctx *ctx, int bit_offset, uint32_t bit_size)
AS_EXTERN bool as_operations_bit_set_int(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, int64_t value)
static bool as_operations_bit_rshift(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint32_t shift)
as_bit_resize_flags
static bool as_operations_bit_subtract(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action)
static void as_bit_policy_init(as_bit_policy *policy)
static bool as_operations_bit_or(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t *value)
static bool as_operations_bit_add(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action)
static bool as_operations_bit_set(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t *value)
AS_EXTERN bool as_operations_bit_get_int(as_operations *ops, const char *name, as_cdt_ctx *ctx, int bit_offset, uint32_t bit_size, bool sign)
static bool as_operations_bit_not(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size)
AS_EXTERN bool as_operations_bit_insert(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int byte_offset, uint32_t value_byte_size, uint8_t *value)
as_bit_write_flags
AS_EXTERN bool as_operations_bit_resize(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, uint32_t byte_size, as_bit_resize_flags flags)
static bool as_operations_bit_lshift(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint32_t shift)
static bool as_operations_bit_count(as_operations *ops, const char *name, as_cdt_ctx *ctx, int bit_offset, uint32_t bit_size)
static bool as_operations_bit_xor(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_bit_policy *policy, int bit_offset, uint32_t bit_size, uint32_t value_byte_size, uint8_t *value)
@ AS_BIT_OVERFLOW_FAIL
@ AS_BIT_OVERFLOW_WRAP
@ AS_BIT_OVERFLOW_SATURATE
@ AS_BIT_RESIZE_GROW_ONLY
@ AS_BIT_RESIZE_DEFAULT
@ AS_BIT_RESIZE_FROM_FRONT
@ AS_BIT_RESIZE_SHRINK_ONLY
@ AS_BIT_WRITE_UPDATE_ONLY
@ AS_BIT_WRITE_DEFAULT
@ AS_BIT_WRITE_NO_FAIL
@ AS_BIT_WRITE_CREATE_ONLY
@ AS_BIT_WRITE_PARTIAL