Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./.././../../../../.././usr/include/libsstore.h
Real path: /usr/include/libsstore.h
Zurück
/* * Copyright (c) 2013, 2022, Oracle and/or its affiliates. */ #ifndef _LIBSSTORE_H #define _LIBSSTORE_H /* * Sstored interfaces - client side include file */ #ifdef __cplusplus extern "C" { #endif #include <libnvpair.h> #include <stdbool.h> #include <stdint.h> #include <time.h> #define SS_TIME_NOW 0xffffffffffffffff #define SS_MAX_SIZE -1 #define SS_SHOW_UNSTABLE 0x00000001 #define SS_SHOW_UNBROWSABLE 0x00000002 #define SS_JSON_FMT_VERSION 1 /* * The Format Types, Error and Warning codes must be kept in sync with * their counterparts in sstore's RAD API. * * Any changes to these enums will require an equivalent update to the sstore * RAD API. */ typedef enum { SSTORE_FMT_NVLIST = 0, SSTORE_FMT_JSON, SSTORE_FMT_CSV, SSTORE_FMT_MAX } sstore_format_t; typedef enum { ESSTORE_OK = 0, ESSTORE_ITER_DONE, ESSTORE_HANDLE_INVALID, ESSTORE_ARG_INVALID, ESSTORE_TOO_BIG, ESSTORE_RETRY, ESSTORE_NOMEM, ESSTORE_CONNECTION_BROKEN, ESSTORE_UNAUTHORIZED, ESSTORE_INTERNAL, ESSTORE_MAX } sstore_err_t; typedef enum { SS_WARN_OK = 0, SS_WARN_INVALID, /* id is not valid for the given operation. */ SS_WARN_INTERNAL, /* Op failed for this id due to an internal error. */ SS_WARN_CONN_BROKEN, /* can't connect to remote sstored */ SS_WARN_UNAUTHORIZED, /* caller isn't authorized */ SS_WARN_NOENT, /* Unable to resolve the requested identifier. */ SS_WARN_NODATA_YET, /* No data has been recorded yet for the given time range */ SS_WARN_MAX } sstore_warning_t; typedef enum { SSTORE_VALUE_UNKNOWN = 0, SSTORE_VALUE_BOOLEAN, SSTORE_VALUE_DICTIONARY, SSTORE_VALUE_DICTIONARY_ARRAY, SSTORE_VALUE_NUMBER, SSTORE_VALUE_NUMBER_ARRAY, SSTORE_VALUE_REAL, SSTORE_VALUE_REAL_ARRAY, SSTORE_VALUE_STRING, SSTORE_VALUE_STRING_ARRAY, SSTORE_VALUE_PARTITION, SSTORE_VALUE_NODATA, SSTORE_VALUE_NODATA_YET, SSTORE_VALUE_HISTOGRAM } sstore_value_type_t; typedef enum { SSTORE_WALK_ID = 0, SSTORE_WALK_TS } sstore_walk_t; typedef enum { SSTORE_ITER_TYPE_UNKNOWN = 0, SSTORE_ITER_TYPE_DATA, SSTORE_ITER_TYPE_INFO, SSTORE_ITER_TYPE_NAMESPACE, SSTORE_ITER_TYPE_BATCH } sstore_iter_type_t; typedef enum { SSTORE_RESULT_TYPE_NONE = 0, SSTORE_RESULT_TYPE_ITER, SSTORE_RESULT_TYPE_ERROR } sstore_result_type_t; typedef enum { SSTORE_COLLECTION_STATE_NONE = 0, SSTORE_COLLECTION_STATE_DISABLED, SSTORE_COLLECTION_STATE_ENABLED } sstore_collection_state_t; typedef enum { SSTORE_HISTOGRAM_TYPE_LINEAR = 0, SSTORE_HISTOGRAM_TYPE_LOG10, SSTORE_HISTOGRAM_TYPE_LOG2, SSTORE_HISTOGRAM_TYPE_LOG10_LINEAR } sstore_histogram_type_t; /* Public opaque sstore handle */ typedef struct sstore_handle *sstore_handle_t; typedef struct sstore_iter *sstore_iter_t; typedef struct sstore_range *sstore_range_t; typedef struct sstore_batch *sstore_batch_t; typedef struct sstore_collection *sstore_collection_t; typedef struct sstore_partition *sstore_partition_t; typedef struct sstore_data *sstore_data_t; typedef struct sstore_histogram *sstore_histogram_t; typedef struct sstore_value { sstore_value_type_t sv_type; uint32_t sv_arr_len; union { boolean_t boolean; uint64_t num; uint64_t *num_arr; double real; double *real_arr; char *str; char **str_arr; nvlist_t *dict; nvlist_t **dict_arr; sstore_partition_t part; sstore_histogram_t hist; } sv_value; } *sstore_value_t; /* Utility APIs */ extern sstore_handle_t sstore_alloc(void); extern void sstore_free(sstore_handle_t); extern sstore_err_t sstore_ping(sstore_handle_t); extern sstore_err_t sstore_set_max_size(sstore_handle_t, size_t); extern sstore_err_t sstore_purge(sstore_handle_t, const char **, uint32_t, sstore_range_t); /* Iterator APIs */ extern void sstore_iter_free(sstore_iter_t); extern sstore_iter_type_t sstore_iter_type(sstore_iter_t); extern sstore_err_t sstore_iter_export(sstore_handle_t, sstore_iter_t, sstore_format_t, void **, size_t *); /* Range APIs */ extern sstore_range_t sstore_range_alloc(void); extern void sstore_range_free(sstore_range_t); extern sstore_range_t sstore_range_by_time(sstore_range_t, uint64_t, uint64_t, uint64_t); extern sstore_range_t sstore_range_by_points(sstore_range_t, uint64_t, int64_t); extern sstore_range_t sstore_range_by_points_stepped(sstore_range_t, uint64_t, int64_t, uint64_t); extern sstore_range_t sstore_range_flags(sstore_range_t, uint64_t); /* Data APIs */ extern sstore_err_t sstore_data_read(sstore_handle_t, const char **, uint32_t, sstore_range_t, sstore_walk_t, sstore_iter_t *); extern sstore_err_t sstore_data_iter_next(sstore_handle_t, sstore_iter_t, char **, uint64_t *, sstore_value_t *); extern sstore_err_t sstore_data_update(sstore_handle_t, const char **, uint32_t, const sstore_value_t *); extern sstore_err_t sstore_data_attach(sstore_handle_t, const char **, uint32_t, uint64_t **); extern sstore_err_t sstore_data_attach_histogram(sstore_handle_t, const char *, sstore_histogram_t); extern sstore_data_t sstore_data_alloc(void); extern void sstore_data_reset(sstore_data_t); extern void sstore_data_free(sstore_data_t); extern sstore_err_t sstore_data_add(sstore_handle_t, sstore_data_t, uint64_t, sstore_value_t); extern sstore_err_t sstore_data_bulk_update(sstore_handle_t, const char **, uint32_t, sstore_data_t *); /* Info APIs */ extern sstore_err_t sstore_info_read(sstore_handle_t, const char **, uint32_t, sstore_range_t range, sstore_iter_t *); extern sstore_err_t sstore_info_iter_next(sstore_handle_t, sstore_iter_t, char **, uint64_t *, sstore_value_t *); /* Namespace APIs */ extern sstore_err_t sstore_namespace_list(sstore_handle_t, const char **, uint32_t, sstore_range_t, sstore_iter_t *); extern sstore_err_t sstore_namespace_iter_next(sstore_handle_t, sstore_iter_t, char **, uint64_t *, uint64_t *); /* Error APIs */ extern const char *sstore_err_description(sstore_handle_t); extern const char *sstore_err_action(sstore_handle_t); extern sstore_err_t sstore_err_code(sstore_handle_t); /* Resource Addition APIs */ extern sstore_err_t sstore_resource_add(sstore_handle_t, const char **, uint32_t, const char *); extern sstore_err_t sstore_resource_remove(sstore_handle_t, const char **, uint32_t); /* * Collection APIs */ extern sstore_collection_t sstore_collection_alloc(const char *); extern sstore_err_t sstore_collection_delete(sstore_handle_t, sstore_collection_t); extern void sstore_collection_free(sstore_collection_t); extern const char *sstore_collection_id(sstore_collection_t); extern sstore_err_t sstore_collection_set_state(sstore_handle_t, sstore_collection_t, sstore_collection_state_t); extern sstore_err_t sstore_collection_update_ssid(sstore_handle_t, sstore_collection_t, const char **, uint32_t, boolean_t); extern sstore_err_t sstore_collection_write(sstore_handle_t, sstore_collection_t); extern sstore_warning_t sstore_warning_next(sstore_handle_t, char **, char **); /* Batch APIs */ extern sstore_batch_t sstore_batch_alloc(void); extern void sstore_batch_free(sstore_batch_t); extern sstore_err_t sstore_batch_data_read(sstore_handle_t, sstore_batch_t, void *, const char **, uint32_t, sstore_range_t, sstore_walk_t); extern sstore_err_t sstore_batch_info_read(sstore_handle_t, sstore_batch_t, void *, const char **, uint32_t, sstore_range_t); extern sstore_err_t sstore_batch_namespace_list(sstore_handle_t, sstore_batch_t, void *, const char **, uint32_t, sstore_range_t); extern sstore_err_t sstore_batch_call(sstore_handle_t, sstore_batch_t, sstore_iter_t *); extern sstore_err_t sstore_batch_iter_next(sstore_handle_t, sstore_iter_t, void **, sstore_iter_t *, sstore_result_type_t *); /* Parition APIs */ extern sstore_partition_t sstore_partition_alloc(uint32_t); extern void sstore_partition_free(sstore_partition_t); extern sstore_err_t sstore_partition_inc_value(sstore_handle_t, sstore_partition_t, const char **, uint64_t); extern sstore_err_t sstore_partition_set_value(sstore_handle_t, sstore_partition_t, const char **, uint64_t); /* Value APIs */ sstore_value_t sstore_value_alloc(void); void sstore_value_free(sstore_value_t); /* Histogram APIs */ extern sstore_err_t sstore_histogram_init(sstore_handle_t, sstore_histogram_type_t, uint64_t, uint64_t, uint64_t, sstore_histogram_t *); extern void sstore_histogram_free(sstore_histogram_t); extern sstore_err_t sstore_histogram_quantize(sstore_handle_t, sstore_histogram_t, uint64_t); extern char *sstore_histogram_bucket(sstore_histogram_type_t, uint64_t, uint64_t, uint64_t, uint64_t); /* Time stamp conversion APIs */ extern const char *sstore_util_epochns_to_iso8601(int64_t, boolean_t); extern int64_t sstore_util_iso8601_to_epochns(const char *); extern int64_t sstore_util_mktimegm(struct tm *, long); extern int64_t sstore_util_timegm(struct tm *, long); /* Private API used by perf-test */ extern sstore_err_t sstore_set_door(sstore_handle_t, char *); #ifdef __cplusplus } #endif #endif /* _LIBSSTORE_H */