All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_rec.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 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 
18 #pragma once
19 
20 #include <aerospike/as_integer.h>
21 #include <aerospike/as_bytes.h>
22 #include <aerospike/as_list.h>
23 #include <aerospike/as_map.h>
24 #include <aerospike/as_string.h>
25 #include <aerospike/as_util.h>
26 #include <aerospike/as_val.h>
27 
28 #include <stdbool.h>
29 #include <stdint.h>
30 
31 /******************************************************************************
32  * TYPES
33  *****************************************************************************/
34 
35 struct as_rec_hooks_s;
36 
37 /**
38  * Callback function for `as_rec_bin_names()`. Used for porting bin names
39  * to Lua.
40  *
41  * @param bin_names A string containing the (null-terminated) bin names.
42  * @param nbins The number of bins in the record.
43  * @param max_name_size The maximum length of a bin name.
44  * @param udata User-provided data.
45  */
46 typedef void (* as_rec_bin_names_callback) (char * bin_names, uint32_t nbins, uint16_t max_name_size, void * udata);
47 
48 /**
49  * Callback function for `as_rec_foreach()`. Called for each bin in the
50  * record.
51  *
52  * @param name The name of the current bin.
53  * @param value The value of the current bin.
54  * @param udata The user-data provided to the `as_rec_foreach()`.
55  *
56  * @return true to continue iterating through the list.
57  * false to stop iterating.
58  */
59 typedef bool (* as_rec_foreach_callback) (const char * name, const as_val * value, void * udata);
60 
61 /**
62  * as_rec is an interface for record types. A record is how data in Aerospike
63  * is represented, and is composed of bins and metadata.
64  *
65  * Implementations:
66  * - as_record
67  *
68  * @extends as_val
69  * @ingroup aerospike_t
70  */
71 typedef struct as_rec_s {
72 
73  /**
74  * @private
75  * as_rec is a subtype of as_val.
76  * You can cast as_rec to as_val.
77  */
79 
80  /**
81  * Data provided by the implementation of `as_rec`.
82  */
83  void * data;
84 
85  /**
86  * Hooks provided by the implementation of `as_rec`.
87  */
88  const struct as_rec_hooks_s * hooks;
89 
90 } as_rec;
91 
92 /**
93  * Record Hooks.
94  *
95  * An implementation of `as_rec` should provide implementations for each
96  * of the hooks.
97  */
98 typedef struct as_rec_hooks_s {
99 
100  /**
101  * Destroy the record.
102  */
103  bool (* destroy)(as_rec * rec);
104 
105  /**
106  * Get the hashcode of the record.
107  */
108  uint32_t (* hashcode)(const as_rec * rec);
109 
110  /**
111  * Get the value of the bin in the record.
112  */
113  as_val * (* get)(const as_rec * rec, const char * name);
114 
115  /**
116  * Set the value of the bin in the record.
117  */
118  int (* set)(const as_rec * rec, const char * name, const as_val * value);
119 
120  /**
121  * Remove the bin from the record.
122  */
123  int (* remove)(const as_rec * rec, const char * bin);
124 
125  /**
126  * Get the ttl value of the record.
127  */
128  uint32_t (* ttl)(const as_rec * rec);
129 
130  /**
131  * Get the generation value of the record.
132  */
133  uint16_t (* gen)(const as_rec * rec);
134 
135  /**
136  * Get the record's key.
137  */
138  as_val * (* key)(const as_rec * rec);
139 
140  /**
141  * Get the record's set name.
142  */
143  const char * (* setname)(const as_rec * rec);
144 
145  /**
146  * Get the number of bins of the record.
147  */
148  uint16_t (* numbins)(const as_rec * rec);
149 
150  /**
151  * Get a list of the record's bin names.
152  */
153  int (* bin_names)(const as_rec * rec, as_rec_bin_names_callback callback, void * udata);
154 
155  /**
156  * Get the digest of the record.
157  */
158  as_bytes * (* digest)(const as_rec * rec);
159 
160  /**
161  * Set flags on a bin.
162  */
163  int (* set_flags)(const as_rec * rec, const char * bin, uint8_t flags);
164 
165  /**
166  * Set the type of record.
167  */
168  int (* set_type)(const as_rec * rec, int8_t type);
169 
170  /**
171  * Set the time to live (ttl) of the record.
172  */
173  int (* set_ttl)(const as_rec * rec, uint32_t ttl);
174 
175  /**
176  * Discard the record's key.
177  */
178  int (* drop_key)(const as_rec * rec);
179 
180  /**
181  * Iterate over each bin in the record.
182  */
183  bool (* foreach)(const as_rec * rec, as_rec_foreach_callback callback, void * udata);
184 
185 } as_rec_hooks;
186 
187 /******************************************************************************
188  * INSTANCE FUNCTIONS
189  *****************************************************************************/
190 
191 /**
192  * @private
193  * Utilized by subtypes of as_rec to initialize the parent.
194  *
195  * @param rec The record to initialize
196  * @param free If TRUE, then as_rec_destory() will free the record.
197  * @param data Data for the map.
198  * @param hooks Implementation for the map interface.
199  *
200  * @return The initialized as_map on success. Otherwise NULL.
201  *
202  * @relatesalso as_rec
203  */
204 as_rec * as_rec_cons(as_rec * rec, bool free, void * data, const as_rec_hooks * hooks);
205 
206 /**
207  * Initialize a stack allocated record.
208  *
209  * @param rec Stack allocated record to initialize.
210  * @param data Data for the record.
211  * @param hooks Implementation for the record interface.
212  *
213  * @return On success, the initialized record. Otherwise NULL.
214  *
215  * @relatesalso as_rec
216  */
217 as_rec * as_rec_init(as_rec * rec, void * data, const as_rec_hooks * hooks);
218 
219 /**
220  * Create and initialize a new heap allocated record.
221  *
222  * @param data Data for the record.
223  * @param hooks Implementation for the record interface.
224  *
225  * @return On success, a new record. Otherwise NULL.
226  *
227  * @relatesalso as_rec
228  */
229 as_rec * as_rec_new(void * data, const as_rec_hooks * hooks);
230 
231 /**
232  * Destroy the record.
233  *
234  * @relatesalso as_rec
235  */
236 static inline void as_rec_destroy(as_rec * rec)
237 {
238  as_val_destroy((as_val *) rec);
239 }
240 
241 /******************************************************************************
242  * INLINE FUNCTIONS
243  ******************************************************************************/
244 
245 /**
246  * Get the data source for the record.
247  *
248  * @relatesalso as_rec
249  */
250 static inline void * as_rec_source(const as_rec * rec)
251 {
252  return rec ? rec->data : NULL;
253 }
254 
255 /**
256  * Remove a bin from a record.
257  *
258  * @param rec The record to remove the bin from.
259  * @param name The name of the bin to remove.
260  *
261  * @return 0 on success, otherwise an error occurred.
262  *
263  * @relatesalso as_rec
264  */
265 static inline int as_rec_remove(const as_rec * rec, const char * name)
266 {
267  return as_util_hook(remove, 1, rec, name);
268 }
269 
270 /**
271  * Get the ttl for the record.
272  *
273  * @relatesalso as_rec
274  */
275 static inline uint32_t as_rec_ttl(const as_rec * rec)
276 {
277  return as_util_hook(ttl, 0, rec);
278 }
279 
280 /**
281  * Get the generation of the record
282  *
283  * @relatesalso as_rec
284  */
285 static inline uint16_t as_rec_gen(const as_rec * rec)
286 {
287  return as_util_hook(gen, 0, rec);
288 }
289 
290 /**
291  * Get the record's key.
292  *
293  * @relatesalso as_rec
294  */
295 static inline as_val * as_rec_key(const as_rec * rec)
296 {
297  return as_util_hook(key, 0, rec);
298 }
299 
300 /**
301  * Get the record's set name.
302  *
303  * @relatesalso as_rec
304  */
305 static inline const char * as_rec_setname(const as_rec * rec)
306 {
307  return as_util_hook(setname, 0, rec);
308 }
309 
310 /**
311  * Get the number of bins in the record.
312  *
313  * @relatesalso as_rec
314  */
315 static inline uint16_t as_rec_numbins(const as_rec * rec)
316 {
317  return as_util_hook(numbins, 0, rec);
318 }
319 
320 /**
321  * Get a list of the bin names in the record.
322  *
323  * @relatesalso as_rec
324  */
325 static inline int as_rec_bin_names(const as_rec * rec, as_rec_bin_names_callback callback, void * udata)
326 {
327  return as_util_hook(bin_names, 0, rec, callback, udata);
328 }
329 
330 /**
331  * Get the digest of the record.
332  *
333  * @relatesalso as_rec
334  */
335 static inline as_bytes * as_rec_digest(const as_rec * rec)
336 {
337  return as_util_hook(digest, 0, rec);
338 }
339 
340 /**
341  * Set flags on a bin.
342  *
343  * @relatesalso as_rec
344  */
345 static inline int as_rec_set_flags(const as_rec * rec, const char * name, uint8_t flags)
346 {
347  return as_util_hook(set_flags, 0, rec, name, flags);
348 }
349 
350 /**
351  * Set the record type.
352  *
353  * @relatesalso as_rec
354  */
355 static inline int as_rec_set_type(const as_rec * rec, int8_t rec_type)
356 {
357  return as_util_hook(set_type, 0, rec, rec_type);
358 }
359 
360 /**
361  * Set the time to live (ttl).
362  *
363  * @relatesalso as_rec
364  */
365 static inline int as_rec_set_ttl(const as_rec * rec, uint32_t ttl)
366 {
367  return as_util_hook(set_ttl, 0, rec, ttl);
368 }
369 
370 /**
371  * Drop the record's key.
372  *
373  * @relatesalso as_rec
374  */
375 static inline int as_rec_drop_key(const as_rec * rec)
376 {
377  return as_util_hook(drop_key, 0, rec);
378 }
379 
380 /******************************************************************************
381  * BIN GETTER FUNCTIONS
382  ******************************************************************************/
383 
384 /**
385  * Get a bin's value.
386  *
387  * @param rec The as_rec to read the bin value from.
388  * @param name The name of the bin.
389  *
390  * @return On success, the value of the bin. Otherwise NULL.
391  *
392  * @relatesalso as_rec
393  */
394 static inline as_val * as_rec_get(const as_rec * rec, const char * name)
395 {
396  return as_util_hook(get, NULL, rec, name);
397 }
398 
399 /**
400  * Get a bin's value as an int64_t.
401  *
402  * @param rec The as_rec to read the bin value from.
403  * @param name The name of the bin.
404  *
405  * @return On success, the value of the bin. Otherwise 0.
406  *
407  * @relatesalso as_rec
408  */
409 static inline int64_t as_rec_get_int64(const as_rec * rec, const char * name)
410 {
411  as_val * v = as_util_hook(get, NULL, rec, name);
413  return i ? as_integer_toint(i) : 0;
414 }
415 
416 /**
417  * Get a bin's value as a NULL terminated string.
418  *
419  * @param rec The as_rec to read the bin value from.
420  * @param name The name of the bin.
421  *
422  * @return On success, the value of the bin. Otherwise NULL.
423  *
424  * @relatesalso as_rec
425  */
426 static inline char * as_rec_get_str(const as_rec * rec, const char * name)
427 {
428  as_val * v = as_util_hook(get, NULL, rec, name);
429  as_string * s = as_string_fromval(v);
430  return s ? as_string_tostring(s) : 0;
431 }
432 
433 /**
434  * Get a bin's value as an as_integer.
435  *
436  * @param rec The as_rec to read the bin value from.
437  * @param name The name of the bin.
438  *
439  * @return On success, the value of the bin. Otherwise NULL.
440  *
441  * @relatesalso as_rec
442  */
443 static inline as_integer * as_rec_get_integer(const as_rec * rec, const char * name)
444 {
445  as_val * v = as_util_hook(get, NULL, rec, name);
446  return as_integer_fromval(v);
447 }
448 
449 /**
450  * Get a bin's value as an as_string.
451  *
452  * @param rec The as_rec to read the bin value from.
453  * @param name The name of the bin.
454  *
455  * @return On success, the value of the bin. Otherwise NULL.
456  *
457  * @relatesalso as_rec
458  */
459 static inline as_string * as_rec_get_string(const as_rec * rec, const char * name)
460 {
461  as_val * v = as_util_hook(get, NULL, rec, name);
462  return as_string_fromval(v);
463 }
464 
465 /**
466  * Get a bin's value as an as_bytes.
467  *
468  * @param rec The as_rec to read the bin value from.
469  * @param name The name of the bin.
470  *
471  * @return On success, the value of the bin. Otherwise NULL.
472  *
473  * @relatesalso as_rec
474  */
475 static inline as_bytes * as_rec_get_bytes(const as_rec * rec, const char * name)
476 {
477  as_val * v = as_util_hook(get, NULL, rec, name);
478  return as_bytes_fromval(v);
479 }
480 
481 /**
482  * Get a bin's value as an as_list.
483  *
484  * @param rec The as_rec to read the bin value from.
485  * @param name The name of the bin.
486  *
487  * @return On success, the value of the bin. Otherwise NULL.
488  *
489  * @relatesalso as_rec
490  */
491 static inline as_list * as_rec_get_list(const as_rec * rec, const char * name)
492 {
493  as_val * v = as_util_hook(get, NULL, rec, name);
494  return as_list_fromval(v);
495 }
496 
497 /**
498  * Get a bin's value as an as_map.
499  *
500  * @param rec The as_rec to read the bin value from.
501  * @param name The name of the bin.
502  *
503  * @return On success, the value of the bin. Otherwise NULL.
504  *
505  * @relatesalso as_rec
506  */
507 static inline as_map * as_rec_get_map(const as_rec * rec, const char * name)
508 {
509  as_val * v = as_util_hook(get, NULL, rec, name);
510  return as_map_fromval(v);
511 }
512 
513 /******************************************************************************
514  * BIN SETTER FUNCTIONS
515  ******************************************************************************/
516 
517 /**
518  * Set the bin's value to an as_val.
519  *
520  * @param rec The as_rec to write the bin value to - CONSUMES REFERENCE
521  * @param name The name of the bin.
522  * @param value The value of the bin.
523  *
524  * @return On success, 0. Otherwise an error occurred.
525  *
526  * @relatesalso as_rec
527  */
528 static inline int as_rec_set(const as_rec * rec, const char * name, const as_val * value)
529 {
530  return as_util_hook(set, 1, rec, name, value);
531 }
532 
533 /**
534  * Set the bin's value to an int64_t.
535  *
536  * @param rec The as_rec storing the bin.
537  * @param name The name of the bin.
538  * @param value The value of the bin.
539  *
540  * @return On success, 0. Otherwise an error occurred.
541  *
542  * @relatesalso as_rec
543  */
544 static inline int as_rec_set_int64(const as_rec * rec, const char * name, int64_t value)
545 {
546  return as_util_hook(set, 1, rec, name, (as_val *) as_integer_new(value));
547 }
548 
549 /**
550  * Set the bin's value to a NULL terminated string.
551  *
552  * @param rec The as_rec storing the bin.
553  * @param name The name of the bin.
554  * @param value The value of the bin.
555  *
556  * @return On success, 0. Otherwise an error occurred.
557  *
558  * @relatesalso as_rec
559  */
560 static inline int as_rec_set_str(const as_rec * rec, const char * name, const char * value)
561 {
562  return as_util_hook(set, 1, rec, name, (as_val *) as_string_new_strdup(value));
563 }
564 
565 /**
566  * Set the bin's value to an as_integer.
567  *
568  * @param rec The as_rec storing the bin.
569  * @param name The name of the bin.
570  * @param value The value of the bin.
571  *
572  * @return On success, 0. Otherwise an error occurred.
573  *
574  * @relatesalso as_rec
575  */
576 static inline int as_rec_set_integer(const as_rec * rec, const char * name, const as_integer * value)
577 {
578  return as_util_hook(set, 1, rec, name, (as_val *) value);
579 }
580 
581 /**
582  * Set the bin's value to an as_string.
583  *
584  * @param rec The as_rec storing the bin.
585  * @param name The name of the bin.
586  * @param value The value of the bin.
587  *
588  * @return On success, 0. Otherwise an error occurred.
589  *
590  * @relatesalso as_rec
591  */
592 static inline int as_rec_set_string(const as_rec * rec, const char * name, const as_string * value)
593 {
594  return as_util_hook(set, 1, rec, name, (as_val *) value);
595 }
596 
597 /**
598  * Set the bin's value to an as_bytes.
599  *
600  * @param rec The as_rec storing the bin.
601  * @param name The name of the bin.
602  * @param value The value of the bin.
603  *
604  * @return On success, 0. Otherwise an error occurred.
605  *
606  * @relatesalso as_rec
607  */
608 static inline int as_rec_set_bytes(const as_rec * rec, const char * name, const as_bytes * value)
609 {
610  return as_util_hook(set, 1, rec, name, (as_val *) value);
611 }
612 
613 /**
614  * Set the bin's value to an as_list.
615  *
616  * @param rec The as_rec storing the bin.
617  * @param name The name of the bin.
618  * @param value The value of the bin.
619  *
620  * @return On success, 0. Otherwise an error occurred.
621  *
622  * @relatesalso as_rec
623  */
624 static inline int as_rec_set_list(const as_rec * rec, const char * name, const as_list * value)
625 {
626  return as_util_hook(set, 1, rec, name, (as_val *) value);
627 }
628 
629 /**
630  * Set the bin's value to an as_map.
631  *
632  * @param rec The as_rec storing the bin.
633  * @param name The name of the bin.
634  * @param value The value of the bin.
635  *
636  * @return On success, 0. Otherwise an error occurred.
637  *
638  * @relatesalso as_rec
639  */
640 static inline int as_rec_set_map(const as_rec * rec, const char * name, const as_map * value)
641 {
642  return as_util_hook(set, 1, rec, name, (as_val *) value);
643 }
644 
645 /******************************************************************************
646  * ITERATION FUNCTIONS
647  ******************************************************************************/
648 
649 /**
650  * Call the callback function for each bin in the record.
651  *
652  * @param rec The as_rec containing the bins to iterate over.
653  * @param callback The function to call for each entry.
654  * @param udata User-data to be passed to the callback.
655  *
656  * @return true if iteration completes fully. false if iteration was aborted.
657  *
658  * @relatesalso as_rec
659  */
660 static inline bool as_rec_foreach(const as_rec * rec, as_rec_foreach_callback callback, void * udata)
661 {
662  return as_util_hook(foreach, false, rec, callback, udata);
663 }
664 
665 /******************************************************************************
666  * CONVERSION FUNCTIONS
667  ******************************************************************************/
668 
669 /**
670  * Convert to an as_val.
671  *
672  * @relatesalso as_rec
673  */
674 static inline as_val * as_rec_toval(const as_rec * rec)
675 {
676  return (as_val *) rec;
677 }
678 
679 /**
680  * Convert from an as_val.
681  *
682  * @relatesalso as_rec
683  */
684 static inline as_rec * as_rec_fromval(const as_val * v)
685 {
686  return as_util_fromval(v, AS_REC, as_rec);
687 }
688 
689 /******************************************************************************
690  * as_val FUNCTIONS
691  ******************************************************************************/
692 
693 /**
694  * @private
695  * Internal helper function for destroying an as_val.
696  */
697 void as_rec_val_destroy(as_val *);
698 
699 /**
700  * @private
701  * Internal helper function for getting the hashcode of an as_val.
702  */
703 uint32_t as_rec_val_hashcode(const as_val *v);
704 
705 /**
706  * @private
707  * Internal helper function for getting the string representation of an as_val.
708  */
709 char * as_rec_val_tostring(const as_val *v);
static as_integer * as_integer_fromval(const as_val *v)
Definition: as_integer.h:230
static uint32_t as_rec_ttl(const as_rec *rec)
Definition: as_rec.h:275
AS_REC
Definition: as_val.h:209
Definition: as_rec.h:71
as_rec * as_rec_cons(as_rec *rec, bool free, void *data, const as_rec_hooks *hooks)
static as_val * as_rec_key(const as_rec *rec)
Definition: as_rec.h:295
static as_map * as_rec_get_map(const as_rec *rec, const char *name)
Definition: as_rec.h:507
uint32_t as_rec_val_hashcode(const as_val *v)
Definition: as_map.h:57
bool(* as_rec_foreach_callback)(const char *name, const as_val *value, void *udata)
Definition: as_rec.h:59
void(* as_rec_bin_names_callback)(char *bin_names, uint32_t nbins, uint16_t max_name_size, void *udata)
Definition: as_rec.h:46
static as_list * as_rec_get_list(const as_rec *rec, const char *name)
Definition: as_rec.h:491
as_rec * as_rec_init(as_rec *rec, void *data, const as_rec_hooks *hooks)
#define as_util_fromval(object, type_id, type)
Definition: as_util.h:38
static int64_t as_integer_toint(const as_integer *integer)
Definition: as_integer.h:208
static int as_rec_set(const as_rec *rec, const char *name, const as_val *value)
Definition: as_rec.h:528
static as_bytes * as_rec_get_bytes(const as_rec *rec, const char *name)
Definition: as_rec.h:475
as_integer * as_integer_new(int64_t value)
Definition: as_val.h:51
as_string * as_string_new_strdup(const char *value)
static bool as_rec_foreach(const as_rec *rec, as_rec_foreach_callback callback, void *udata)
Definition: as_rec.h:660
static int as_rec_drop_key(const as_rec *rec)
Definition: as_rec.h:375
void as_rec_val_destroy(as_val *)
static int64_t as_rec_get_int64(const as_rec *rec, const char *name)
Definition: as_rec.h:409
#define as_util_hook(hook, default, object, args...)
Definition: as_util.h:32
static as_val * as_rec_get(const as_rec *rec, const char *name)
Definition: as_rec.h:394
static char * as_rec_get_str(const as_rec *rec, const char *name)
Definition: as_rec.h:426
static int as_rec_remove(const as_rec *rec, const char *name)
Definition: as_rec.h:265
static void as_rec_destroy(as_rec *rec)
Definition: as_rec.h:236
static uint16_t as_rec_numbins(const as_rec *rec)
Definition: as_rec.h:315
void * data
Definition: as_rec.h:83
static as_string * as_rec_get_string(const as_rec *rec, const char *name)
Definition: as_rec.h:459
static const char * as_rec_setname(const as_rec *rec)
Definition: as_rec.h:305
static as_rec * as_rec_fromval(const as_val *v)
Definition: as_rec.h:684
static int as_rec_set_list(const as_rec *rec, const char *name, const as_list *value)
Definition: as_rec.h:624
static int as_rec_set_int64(const as_rec *rec, const char *name, int64_t value)
Definition: as_rec.h:544
static as_bytes * as_bytes_fromval(const as_val *v)
Definition: as_bytes.h:911
as_val _
Definition: as_rec.h:78
static int as_rec_bin_names(const as_rec *rec, as_rec_bin_names_callback callback, void *udata)
Definition: as_rec.h:325
static int as_rec_set_bytes(const as_rec *rec, const char *name, const as_bytes *value)
Definition: as_rec.h:608
static char * as_string_tostring(const as_string *string)
Definition: as_string.h:225
static as_string * as_string_fromval(const as_val *v)
Definition: as_string.h:261
static as_list * as_list_fromval(as_val *v)
Definition: as_list.h:1269
static int as_rec_set_flags(const as_rec *rec, const char *name, uint8_t flags)
Definition: as_rec.h:345
static void * as_rec_source(const as_rec *rec)
Definition: as_rec.h:250
static int as_rec_set_ttl(const as_rec *rec, uint32_t ttl)
Definition: as_rec.h:365
struct as_rec_hooks_s * hooks
Definition: as_rec.h:88
static as_bytes * as_rec_digest(const as_rec *rec)
Definition: as_rec.h:335
static as_map * as_map_fromval(const as_val *val)
Definition: as_map.h:402
static int as_rec_set_type(const as_rec *rec, int8_t rec_type)
Definition: as_rec.h:355
#define as_val_destroy(__v)
Definition: as_val.h:104
static int as_rec_set_str(const as_rec *rec, const char *name, const char *value)
Definition: as_rec.h:560
char * as_rec_val_tostring(const as_val *v)
static int as_rec_set_string(const as_rec *rec, const char *name, const as_string *value)
Definition: as_rec.h:592
static uint16_t as_rec_gen(const as_rec *rec)
Definition: as_rec.h:285
static int as_rec_set_integer(const as_rec *rec, const char *name, const as_integer *value)
Definition: as_rec.h:576
static int as_rec_set_map(const as_rec *rec, const char *name, const as_map *value)
Definition: as_rec.h:640
as_rec * as_rec_new(void *data, const as_rec_hooks *hooks)
static as_integer * as_rec_get_integer(const as_rec *rec, const char *name)
Definition: as_rec.h:443
static as_val * as_rec_toval(const as_rec *rec)
Definition: as_rec.h:674