C Configuration Space and Tuning Library (CCS)
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1#ifndef _CCS_BASE_H
2#define _CCS_BASE_H
3#include <limits.h>
4#include <math.h>
5#include <string.h>
6
22#ifdef __cplusplus
23extern "C" {
24#endif
25
29typedef double ccs_float_t;
33typedef int64_t ccs_int_t;
37typedef int32_t ccs_bool_t;
41typedef uint32_t ccs_hash_t;
42
46typedef struct {
48 uint16_t revision;
50 uint16_t patch;
52 uint16_t minor;
54 uint16_t major;
56
60extern const ccs_version_t ccs_version;
61
65#define CCS_TRUE ((ccs_bool_t)(1))
69#define CCS_FALSE ((ccs_bool_t)(0))
70
74#define CCS_INT_MAX INT64_MAX
78#define CCS_INT_MIN INT64_MIN
82#define CCS_INFINITY INFINITY
83
87typedef struct _ccs_rng_s *ccs_rng_t;
91typedef struct _ccs_distribution_s *ccs_distribution_t;
95typedef struct _ccs_parameter_s *ccs_parameter_t;
99typedef struct _ccs_expression_s *ccs_expression_t;
103typedef struct _ccs_context_s *ccs_context_t;
107typedef struct _ccs_distribution_space_s *ccs_distribution_space_t;
111typedef struct _ccs_search_space_s *ccs_search_space_t;
115typedef struct _ccs_configuration_space_s *ccs_configuration_space_t;
119typedef struct _ccs_binding_s *ccs_binding_t;
123typedef struct _ccs_search_configuration_s *ccs_search_configuration_t;
127typedef struct _ccs_configuration_s *ccs_configuration_t;
131typedef struct _ccs_feature_space_s *ccs_feature_space_t;
135typedef struct _ccs_features_s *ccs_features_t;
139typedef struct _ccs_objective_space_s *ccs_objective_space_t;
143typedef struct _ccs_evaluation_s *ccs_evaluation_t;
147typedef struct _ccs_tuner_s *ccs_tuner_t;
151typedef struct _ccs_map_s *ccs_map_t;
155typedef struct _ccs_error_stack_s *ccs_error_stack_t;
159typedef struct _ccs_tree_s *ccs_tree_t;
163typedef struct _ccs_tree_space_s *ccs_tree_space_t;
167typedef struct _ccs_tree_configuration_s *ccs_tree_configuration_t;
168
243
248
253
297
302
326
331
355
360
365typedef uint32_t ccs_datum_flags_t;
366
380
385
389typedef void *ccs_object_t;
390
399#ifdef __cplusplus
400 ccs_numeric_u(void)
401 : i(0L)
402 {
403 }
404 ccs_numeric_u(float v)
405 : f((ccs_float_t)v)
406 {
407 }
408 ccs_numeric_u(int v)
409 : i((ccs_int_t)v)
410 {
411 }
413 : i(v)
414 {
415 }
417 : f(v)
418 {
419 }
420#endif
421};
422
427
428#ifdef __cplusplus
429#define CCSF(v) v
430#define CCSI(v) v
431#else
435#define CCSF(v) ((ccs_numeric_t){.f = v})
439#define CCSI(v) ((ccs_numeric_t){.i = v})
440#endif
441
451 const char *s;
454#ifdef __cplusplus
455 ccs_value_u(void)
456 : i(0L)
457 {
458 }
459 ccs_value_u(float v)
460 : f((ccs_float_t)v)
461 {
462 }
463 ccs_value_u(int v)
464 : i((ccs_int_t)v)
465 {
466 }
468 : f(v)
469 {
470 }
472 : i(v)
473 {
474 }
475 ccs_value_u(char *v)
476 : s(v)
477 {
478 }
480 : o(v)
481 {
482 }
483#endif
484};
485
490
502
507
513static inline ccs_datum_t
515{
516 ccs_datum_t d;
518 d.value.i = v;
520 return d;
521}
522
528static inline ccs_datum_t
530{
531 ccs_datum_t d;
533 d.value.f = v;
535 return d;
536}
537
543static inline ccs_datum_t
545{
546 ccs_datum_t d;
548 d.value.i = v;
550 return d;
551}
552
558static inline ccs_datum_t
560{
561 ccs_datum_t d;
563 d.value.o = v;
565 return d;
566}
567
573static inline ccs_datum_t
574ccs_string(const char *v)
575{
576 ccs_datum_t d;
578 d.value.s = v;
580 return d;
581}
582
591static inline int
593{
594 if (a.type < b.type) {
595 return -1;
596 } else if (a.type > b.type) {
597 return 1;
598 } else {
599 switch (a.type) {
601 if (a.value.s == b.value.s)
602 return 0;
603 else if (!a.value.s)
604 return -1;
605 else if (!b.value.s)
606 return 1;
607 else
608 return strcmp(a.value.s, b.value.s);
609 break;
611 return a.value.i < b.value.i ? -1 :
612 a.value.i > b.value.i ? 1 :
613 0;
614 break;
616 return a.value.f < b.value.f ? -1 :
617 a.value.f > b.value.f ? 1 :
618 0;
619 break;
622 return 0;
623 break;
624 default:
625 return memcmp(
626 &(a.value), &(b.value), sizeof(ccs_value_t));
627 }
628 }
629}
630
634extern const ccs_datum_t ccs_none;
638extern const ccs_datum_t ccs_inactive;
642extern const ccs_datum_t ccs_true;
646extern const ccs_datum_t ccs_false;
647
651#define CCS_NONE_VAL \
652 { \
653 {0}, CCS_DATA_TYPE_NONE, CCS_DATUM_FLAG_DEFAULT \
654 }
658#define CCS_INACTIVE_VAL \
659 { \
660 {0}, CCS_DATA_TYPE_INACTIVE, CCS_DATUM_FLAG_DEFAULT \
661 }
662#ifdef __cplusplus
663#define CCS_TRUE_VAL \
664 { \
665 {(ccs_int_t)CCS_TRUE}, CCS_DATA_TYPE_BOOL, \
666 CCS_DATUM_FLAG_DEFAULT \
667 }
668#define CCS_FALSE_VAL \
669 { \
670 {(ccs_int_t)CCS_FALSE}, CCS_DATA_TYPE_BOOL, \
671 CCS_DATUM_FLAG_DEFAULT \
672 }
673#else
677#define CCS_TRUE_VAL \
678 { \
679 {.i = CCS_TRUE}, CCS_DATA_TYPE_BOOL, CCS_DATUM_FLAG_DEFAULT \
680 }
684#define CCS_FALSE_VAL \
685 { \
686 {.i = CCS_FALSE}, CCS_DATA_TYPE_BOOL, CCS_DATUM_FLAG_DEFAULT \
687 }
688#endif
689
699extern ccs_result_t
701
711extern ccs_result_t
713
725extern ccs_result_t
726ccs_get_result_name(ccs_result_t result, const char **name);
727
734extern ccs_version_t
736
743extern const char *
745
754extern ccs_result_t
756
768extern ccs_result_t
770
782extern ccs_result_t
784
797extern ccs_result_t
798ccs_object_get_refcount(ccs_object_t object, int32_t *refcount_ret);
799
803typedef void (
804 *ccs_object_destroy_callback_t)(ccs_object_t object, void *user_data);
805
818extern ccs_result_t
820 ccs_object_t object,
822 void *user_data);
823
833extern ccs_result_t
834ccs_object_set_user_data(ccs_object_t object, void *user_data);
835
847extern ccs_result_t
848ccs_object_get_user_data(ccs_object_t object, void **user_data_ret);
849
872 ccs_object_t object,
873 size_t serialize_data_size,
874 void *serialize_data,
875 size_t *serialize_data_size_ret,
876 void *callback_user_data);
877
892extern ccs_result_t
894 ccs_object_t object,
896 void *user_data);
897
913
935
955
986
1005 ccs_object_t object,
1006 size_t serialize_data_size,
1007 const char *serialize_data,
1008 void *callback_user_data);
1009
1034 const char *name,
1035 void *callback_user_data,
1036 void **vector_ret,
1037 void **data_ret);
1038
1088
1145extern ccs_result_t
1147 ccs_object_t object,
1149 ccs_serialize_operation_t operation,
1150 ...);
1151
1219extern ccs_result_t
1221 ccs_object_t *object_ret,
1224 ...);
1225
1226#ifdef __cplusplus
1227}
1228#endif
1229
1230#endif //_CCS_BASE_H
ccs_result_t ccs_retain_object(ccs_object_t object)
Retain a CCS object, incrementing the internal reference counting.
enum ccs_deserialize_option_e ccs_deserialize_option_t
A commodity type to represent CCS deserialization options.
Definition base.h:1087
static ccs_datum_t ccs_string(const char *v)
A helper function to construct a datum containing a string value.
Definition base.h:574
int64_t ccs_int_t
A CCS integer type.
Definition base.h:33
enum ccs_serialize_option_e ccs_serialize_option_t
A commodity type to represent CCS serialization options.
Definition base.h:985
ccs_result_t ccs_release_object(ccs_object_t object)
Release a CCS object, decrementing the internal reference counting.
ccs_deserialize_option_e
The different deserialization options.
Definition base.h:1042
@ CCS_DESERIALIZE_OPTION_MAP_HANDLES
Secifies that handles have to be mapped.
Definition base.h:1057
@ CCS_DESERIALIZE_OPTION_VECTOR_CALLBACK
The next parameter is a pointer to a callback of type ccs_object_deserialize_vector_callback_t and it...
Definition base.h:1063
@ CCS_DESERIALIZE_OPTION_NON_BLOCKING
The file descriptor operation is non-blocking.
Definition base.h:1071
@ CCS_DESERIALIZE_OPTION_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:1082
@ CCS_DESERIALIZE_OPTION_DATA_CALLBACK
The next parameters are a deserialization callback and its user_data.
Definition base.h:1078
@ CCS_DESERIALIZE_OPTION_END
Option list terminator.
Definition base.h:1044
@ CCS_DESERIALIZE_OPTION_HANDLE_MAP
The next parameter is a ccs_handle_map_t object that must contain the mappings required to deserializ...
Definition base.h:1050
@ CCS_DESERIALIZE_OPTION_MAX
Guard.
Definition base.h:1080
ccs_result_t(* ccs_object_deserialize_vector_callback_t)(ccs_object_type_t type, const char *name, void *callback_user_data, void **vector_ret, void **data_ret)
The type of CCS user object vector deserialization callbacks.
Definition base.h:1032
int32_t ccs_bool_t
A CCS boolean type.
Definition base.h:37
void(* ccs_object_destroy_callback_t)(ccs_object_t object, void *user_data)
The type of CCS object destruction callbacks.
Definition base.h:804
const ccs_datum_t ccs_none
A variable containing an empty datum.
enum ccs_deserialize_operation_e ccs_deserialize_operation_t
A commodity type to represent CCS deserialization operations.
Definition base.h:954
struct _ccs_tree_space_s * ccs_tree_space_t
An opaque type defining a CCS tree space.
Definition base.h:163
enum ccs_serialize_operation_e ccs_serialize_operation_t
A commodity type to represent CCS serialization operations.
Definition base.h:934
void * ccs_object_t
A type representing a generic CCS object.
Definition base.h:389
struct _ccs_expression_s * ccs_expression_t
An opaque type defining a CCS expression.
Definition base.h:99
ccs_datum_flag_e
Flags that can be attached to a CCS datum.
Definition base.h:335
@ CCS_DATUM_FLAG_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:353
@ CCS_DATUM_FLAG_DEFAULT
Empty default flags.
Definition base.h:337
@ CCS_DATUM_FLAG_TRANSIENT
The value given to CCS is a pointer and is not guaranteed to stay allocated.
Definition base.h:342
@ CCS_DATUM_FLAG_ID
The object handle is just an identifier.
Definition base.h:351
@ CCS_DATUM_FLAG_UNPOOLED
The value returned by CCS is a pointer and is not associated to a CCS object and needs to be freed by...
Definition base.h:347
enum ccs_data_type_e ccs_data_type_t
A commodity type to represent CCS data types.
Definition base.h:330
ccs_result_t ccs_object_set_serialize_callback(ccs_object_t object, ccs_object_serialize_callback_t callback, void *user_data)
Set the object serialization callback.
ccs_data_type_e
CCS supported data types.
Definition base.h:306
@ CCS_DATA_TYPE_BOOL
ccs_bool_t
Definition base.h:314
@ CCS_DATA_TYPE_INT
A ccs_int_t.
Definition base.h:310
@ CCS_DATA_TYPE_STRING
A pointer to a NULL terminated string.
Definition base.h:316
@ CCS_DATA_TYPE_NONE
An empty value.
Definition base.h:308
@ CCS_DATA_TYPE_OBJECT
A CCS object.
Definition base.h:320
@ CCS_DATA_TYPE_MAX
Guard.
Definition base.h:322
@ CCS_DATA_TYPE_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:324
@ CCS_DATA_TYPE_INACTIVE
An inactive value.
Definition base.h:318
@ CCS_DATA_TYPE_FLOAT
ccs_float_t
Definition base.h:312
struct _ccs_binding_s * ccs_binding_t
An opaque type defining a CCS binding.
Definition base.h:119
struct _ccs_feature_space_s * ccs_feature_space_t
An opaque type defining a CCS feature space.
Definition base.h:131
ccs_object_type_e
CCS object types.
Definition base.h:257
@ CCS_OBJECT_TYPE_FEATURES
A set of features.
Definition base.h:279
@ CCS_OBJECT_TYPE_MAX
Guard.
Definition base.h:293
@ CCS_OBJECT_TYPE_RNG
A random number generator.
Definition base.h:259
@ CCS_OBJECT_TYPE_PARAMETER
A parameter.
Definition base.h:263
@ CCS_OBJECT_TYPE_TREE
A tree structure.
Definition base.h:285
@ CCS_OBJECT_TYPE_TREE_CONFIGURATION
A configuration on a tree space.
Definition base.h:289
@ CCS_OBJECT_TYPE_DISTRIBUTION_SPACE
A distribution space.
Definition base.h:291
@ CCS_OBJECT_TYPE_ERROR_STACK
An error stack.
Definition base.h:283
@ CCS_OBJECT_TYPE_OBJECTIVE_SPACE
An objective space.
Definition base.h:271
@ CCS_OBJECT_TYPE_EXPRESSION
An arithmetic expression.
Definition base.h:265
@ CCS_OBJECT_TYPE_TREE_SPACE
A tree space.
Definition base.h:287
@ CCS_OBJECT_TYPE_TUNER
A tuner.
Definition base.h:275
@ CCS_OBJECT_TYPE_DISTRIBUTION
A numerical distribution.
Definition base.h:261
@ CCS_OBJECT_TYPE_CONFIGURATION
A configuration.
Definition base.h:269
@ CCS_OBJECT_TYPE_CONFIGURATION_SPACE
A configuration space.
Definition base.h:267
@ CCS_OBJECT_TYPE_EVALUATION
An evaluation of a configuration.
Definition base.h:273
@ CCS_OBJECT_TYPE_FEATURE_SPACE
A feature space.
Definition base.h:277
@ CCS_OBJECT_TYPE_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:295
@ CCS_OBJECT_TYPE_MAP
A key value store.
Definition base.h:281
static ccs_datum_t ccs_bool(ccs_bool_t v)
A helper function to construct a datum containing a boolean value.
Definition base.h:514
uint32_t ccs_datum_flags_t
A type representing the combination of flags that can be attached to a CCS datum.
Definition base.h:365
ccs_result_t(* ccs_object_deserialize_data_callback_t)(ccs_object_t object, size_t serialize_data_size, const char *serialize_data, void *callback_user_data)
The type of CCS object data deserialization callbacks.
Definition base.h:1004
static int ccs_datum_cmp(const ccs_datum_t a, const ccs_datum_t b)
A helper function providing a strict ordering of datum.
Definition base.h:592
const ccs_datum_t ccs_true
A variable containing a boolean true datum.
const ccs_version_t ccs_version
A variable containing the current version of the CCS library.
struct _ccs_search_configuration_s * ccs_search_configuration_t
An opaque type defining a CCS search space configuration.
Definition base.h:123
const char * ccs_get_version_string(void)
Query the library version string.
ccs_result_t ccs_object_set_destroy_callback(ccs_object_t object, ccs_object_destroy_callback_t callback, void *user_data)
Attach a destruction callback to a CCS object.
struct _ccs_parameter_s * ccs_parameter_t
An opaque type defining a CCS parameter.
Definition base.h:95
ccs_result_t ccs_object_set_user_data(ccs_object_t object, void *user_data)
Set the associated user_data pointer of a CCS object.
int32_t ccs_evaluation_result_t
The result type used for evaluations.
Definition base.h:252
struct _ccs_objective_space_s * ccs_objective_space_t
An opaque type defining a CCS objective space.
Definition base.h:139
ccs_result_e
The different possible return codes of a CCS function.
Definition base.h:173
@ CCS_RESULT_ERROR_INVALID_CONDITION
The condition is invalid (unused)
Definition base.h:199
@ CCS_RESULT_ERROR_NOT_ENOUGH_DATA
The provided buffer or file is too short.
Definition base.h:223
@ CCS_RESULT_MIN
Guard.
Definition base.h:239
@ CCS_RESULT_ERROR_UNSUPPORTED_OPERATION
The object does not support this operation.
Definition base.h:215
@ CCS_RESULT_ERROR_INVALID_TYPE
The data type is invalid.
Definition base.h:185
@ CCS_RESULT_ERROR_TYPE_NOT_COMPARABLE
The type is not comparable (unused)
Definition base.h:205
@ CCS_RESULT_ERROR_INVALID_FEATURES
The provided features is invalid.
Definition base.h:219
@ CCS_RESULT_ERROR_INVALID_DISTRIBUTION_SPACE
The provided tree tuner is invalid.
Definition base.h:237
@ CCS_RESULT_MAX
Guard.
Definition base.h:175
@ CCS_RESULT_ERROR_INVALID_EXPRESSION
The provided expression is invalid.
Definition base.h:191
@ CCS_RESULT_ERROR_EXTERNAL
External error occurred (binding?)
Definition base.h:231
@ CCS_RESULT_ERROR_INVALID_GRAPH
The constraint graph would be invalid.
Definition base.h:203
@ CCS_RESULT_AGAIN
Try again.
Definition base.h:177
@ CCS_RESULT_ERROR_SYSTEM
A system error occurred.
Definition base.h:229
@ CCS_RESULT_ERROR_SAMPLING_UNSUCCESSFUL
Could not gather enough samples.
Definition base.h:211
@ CCS_RESULT_ERROR_INVALID_CONFIGURATION
The provided configuration is invalid.
Definition base.h:195
@ CCS_RESULT_ERROR_INVALID_TREE
The provided tree is invalid.
Definition base.h:233
@ CCS_RESULT_ERROR_INVALID_SCALE
The provided scale is invalid.
Definition base.h:187
@ CCS_RESULT_ERROR_INVALID_NAME
The parameter name is invalid.
Definition base.h:197
@ CCS_RESULT_ERROR_INVALID_EVALUATION
The provided evaluation is invalid.
Definition base.h:217
@ CCS_RESULT_ERROR_INVALID_BOUNDS
The bounds are invalid (unused)
Definition base.h:207
@ CCS_RESULT_SUCCESS
Success.
Definition base.h:179
@ CCS_RESULT_ERROR_INVALID_OBJECT
Not a CCS object or not initialized.
Definition base.h:181
@ CCS_RESULT_ERROR_INVALID_TUNER
The provided tuner is invalid.
Definition base.h:201
@ CCS_RESULT_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:241
@ CCS_RESULT_ERROR_INVALID_VALUE
Parameter has an invalid value.
Definition base.h:183
@ CCS_RESULT_ERROR_OUT_OF_MEMORY
An allocation failed due to lack of available memory.
Definition base.h:213
@ CCS_RESULT_ERROR_INVALID_PARAMETER
The provided parameter is invalid.
Definition base.h:193
@ CCS_RESULT_ERROR_INVALID_HANDLE
The handle was not found.
Definition base.h:227
@ CCS_RESULT_ERROR_DUPLICATE_HANDLE
The handle was a duplicate.
Definition base.h:225
@ CCS_RESULT_ERROR_INVALID_FILE_PATH
The provided file path is invalid.
Definition base.h:221
@ CCS_RESULT_ERROR_INVALID_TREE_SPACE
The provided tree space is invalid.
Definition base.h:235
@ CCS_RESULT_ERROR_OUT_OF_BOUNDS
The index is out of bounds.
Definition base.h:209
@ CCS_RESULT_ERROR_INVALID_DISTRIBUTION
The provided distribution is invalid.
Definition base.h:189
ccs_serialize_operation_e
The different serialization operations supported by CCS.
Definition base.h:917
@ CCS_SERIALIZE_OPERATION_FILE_DESCRIPTOR
Serialize the ojbect in the given file descriptor.
Definition base.h:925
@ CCS_SERIALIZE_OPERATION_MAX
Guard.
Definition base.h:927
@ CCS_SERIALIZE_OPERATION_FILE
Serialize the object in a file at the given path.
Definition base.h:923
@ CCS_SERIALIZE_OPERATION_MEMORY
Serialize the object in a user provided memory buffer.
Definition base.h:921
@ CCS_SERIALIZE_OPERATION_SIZE
Query the memory footprint of the serialized object.
Definition base.h:919
@ CCS_SERIALIZE_OPERATION_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:929
enum ccs_datum_flag_e ccs_datum_flag_t
A commodity type to represent CCS datum flags.
Definition base.h:359
const ccs_datum_t ccs_false
A variable containing a boolean false datum.
struct _ccs_configuration_s * ccs_configuration_t
An opaque type defining a CCS configuration.
Definition base.h:127
const ccs_datum_t ccs_inactive
A variable containing an inactive datum.
struct _ccs_search_space_s * ccs_search_space_t
An opaque type defining a CCS search space.
Definition base.h:111
struct _ccs_distribution_space_s * ccs_distribution_space_t
An opaque type defining a CCS distribution space.
Definition base.h:107
struct _ccs_tuner_s * ccs_tuner_t
An opaque type defining a CCS tuner.
Definition base.h:147
struct _ccs_evaluation_s * ccs_evaluation_t
An opaque type defining a CCS evaluation.
Definition base.h:143
ccs_version_t ccs_get_version(void)
Query the library API version.
ccs_result_t ccs_init(void)
The library initialization function.
struct _ccs_context_s * ccs_context_t
An opaque type defining a CCS context.
Definition base.h:103
double ccs_float_t
A CCS floating point type.
Definition base.h:29
uint32_t ccs_hash_t
A CCS hashing value type.
Definition base.h:41
ccs_result_t ccs_object_get_refcount(ccs_object_t object, int32_t *refcount_ret)
Get an object internal reference counting.
struct _ccs_tree_configuration_s * ccs_tree_configuration_t
An opaque type defining a CCS tree space configuration.
Definition base.h:167
static ccs_datum_t ccs_float(ccs_float_t v)
A helper function to construct a datum containing a floating point value.
Definition base.h:529
ccs_result_t ccs_object_serialize(ccs_object_t object, ccs_serialize_format_t format, ccs_serialize_operation_t operation,...)
Perform a serialization operation on a CCS object.
struct _ccs_features_s * ccs_features_t
An opaque type defining a CCS features.
Definition base.h:135
struct _ccs_tree_s * ccs_tree_t
An opaque type defining a CCS tree.
Definition base.h:159
ccs_result_t(* ccs_object_serialize_callback_t)(ccs_object_t object, size_t serialize_data_size, void *serialize_data, size_t *serialize_data_size_ret, void *callback_user_data)
The type of CCS object serialization callbacks.
Definition base.h:871
ccs_deserialize_operation_e
CCS deserialization operations.
Definition base.h:939
@ CCS_DESERIALIZE_OPERATION_FILE
Deserialize the object from a file at the given path.
Definition base.h:943
@ CCS_DESERIALIZE_OPERATION_MAX
Guard.
Definition base.h:947
@ CCS_DESERIALIZE_OPERATION_MEMORY
Deserialize the object from a user provided memory buffer.
Definition base.h:941
@ CCS_DESERIALIZE_OPERATION_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:949
@ CCS_DESERIALIZE_OPERATION_FILE_DESCRIPTOR
Deserialize the object from the given file descriptor.
Definition base.h:945
struct _ccs_error_stack_s * ccs_error_stack_t
An opaque type defining a CCS error stack.
Definition base.h:155
struct _ccs_configuration_space_s * ccs_configuration_space_t
An opaque type defining a CCS configuration space.
Definition base.h:115
enum ccs_numeric_type_e ccs_numeric_type_t
A commodity type to represent CCS numeric types.
Definition base.h:384
static ccs_datum_t ccs_int(ccs_int_t v)
A helper function to construct a datum containing an integer value.
Definition base.h:544
ccs_result_t ccs_object_get_user_data(ccs_object_t object, void **user_data_ret)
Get the associated user_data pointer of a CCS object.
enum ccs_object_type_e ccs_object_type_t
A commodity type to represent CCS object types.
Definition base.h:301
ccs_result_t ccs_get_result_name(ccs_result_t result, const char **name)
Return the string corresponding to the provided CCS result.
enum ccs_result_e ccs_result_t
A commodity type to represent CCS errors and returned by most functions.
Definition base.h:247
enum ccs_serialize_format_e ccs_serialize_format_t
A commodity type to represent CCS serialization formats.
Definition base.h:912
ccs_result_t ccs_object_deserialize(ccs_object_t *object_ret, ccs_serialize_format_t format, ccs_deserialize_operation_t operation,...)
Perform a deserialization operation and return a new CCS object.
struct _ccs_map_s * ccs_map_t
An opaque type defining a CCS key-value store.
Definition base.h:151
struct _ccs_rng_s * ccs_rng_t
An opaque type defining a CCS random generator.
Definition base.h:87
struct _ccs_distribution_s * ccs_distribution_t
An opaque type defining a CCS distribution.
Definition base.h:91
ccs_serialize_format_e
The different serialization formats supported by CCS.
Definition base.h:901
@ CCS_SERIALIZE_FORMAT_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:907
@ CCS_SERIALIZE_FORMAT_BINARY
A binary format that should be compact and performant.
Definition base.h:903
@ CCS_SERIALIZE_FORMAT_MAX
Guard.
Definition base.h:905
static ccs_datum_t ccs_object(ccs_object_t v)
A helper function to construct a datum containing a CCS object value.
Definition base.h:559
ccs_serialize_option_e
The different serialization options.
Definition base.h:959
@ CCS_SERIALIZE_OPTION_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:980
@ CCS_SERIALIZE_OPTION_CALLBACK
The next parameters are a serialization callback and it's user_data.
Definition base.h:976
@ CCS_SERIALIZE_OPTION_NON_BLOCKING
The file descriptor operation is non-blocking.
Definition base.h:969
@ CCS_SERIALIZE_OPTION_MAX
Guard.
Definition base.h:978
@ CCS_SERIALIZE_OPTION_END
Option list terminator.
Definition base.h:961
ccs_result_t ccs_fini(void)
The library deinitialization function.
ccs_result_t ccs_object_get_type(ccs_object_t object, ccs_object_type_t *type_ret)
Get a CCS object type.
ccs_numeric_type_e
The subset of CCS data types that represent numerical data.
Definition base.h:370
@ CCS_NUMERIC_TYPE_MAX
Guard.
Definition base.h:376
@ CCS_NUMERIC_TYPE_FORCE_32BIT
Try forcing 32 bits value for bindings.
Definition base.h:378
@ CCS_NUMERIC_TYPE_INT
A ccs_int_t.
Definition base.h:372
@ CCS_NUMERIC_TYPE_FLOAT
A ccs_float_t.
Definition base.h:374
A Structure containing a CCS datum.
Definition base.h:494
ccs_value_t value
The value of the datum.
Definition base.h:496
ccs_data_type_t type
The type of the datum.
Definition base.h:498
ccs_datum_flags_t flags
The flags attached to the datum.
Definition base.h:500
A structure representing a version of the CCS API.
Definition base.h:46
uint16_t major
Major version number.
Definition base.h:54
uint16_t patch
Patch version number.
Definition base.h:50
uint16_t revision
Revision version number.
Definition base.h:48
uint16_t minor
Minor version number.
Definition base.h:52
A union that can contain either a ccs_int_t or a ccs_float_t.
Definition base.h:394
ccs_float_t f
The floating point value of the union.
Definition base.h:396
ccs_int_t i
The integer value of the union.
Definition base.h:398
A union that represent a CCS datum value.
Definition base.h:445
const char * s
The string value of the union.
Definition base.h:451
ccs_float_t f
The floating point value of the union.
Definition base.h:447
ccs_object_t o
The CCS object value of the union.
Definition base.h:453
ccs_int_t i
The integer value of the union.
Definition base.h:449