|
Defines |
| #define | ID_COUNTER_FILE ".ic" |
| #define | MODEL_STORAGE_DB "modelstorage.db" |
| #define | MODEL_STORAGE_LOG "modelstorage.log" |
| #define | MODEL_STORAGE_MAX_CLIENTS 100 |
| | The max number of simultaneously running clients (model_storage instances).
|
| #define | MODEL_STORAGE_MAX_GRULES 100 |
| | The max number of get-rules.
|
| #define | MODEL_STORAGE_MAX_READINGS 6000 |
| #define | MODEL_STORAGE_MAX_SRULES 100 |
| | The max number of set-rules.
|
| #define | MODEL_STORAGE_MAX_TXNS 100 |
| | The max number of transactions that can be run simultaneously.
|
| #define | MODEL_STORAGE_MAX_UPDATINGS 400 |
| | The max number of update operations per transaction.
|
| #define | MODELSTORAGE_ERR_ENCRYPTED -2014 |
| #define | MODELSTORAGE_ERR_LOCKED -2011 |
| | The max number of readings per transaction.
|
| #define | MODELSTORAGE_ERR_READING -2015 |
| #define | MODELSTORAGE_ERR_UNDECRYPTED -2016 |
| #define | MS_MAX_PATH 1024 |
| #define | MS_MAX_URI 1024 |
| #define | MS_STORAGE_TYPE extern |
Typedefs |
| typedef _model_storage | ModelStorage |
| | Model storage state.
|
| typedef _model_storage_env | ModelStorageEnv |
| | Model Storage Environment.
|
| typedef _ms_blob | MSBlob |
| | Model Storage BLOB.
|
| typedef void(* | MSNotify )(const Statement *list, void *data) |
| | Notification callback function.
|
| typedef void( | MSProgress )(double percent, char *message, void *data) |
| | Progress notification for various purposes.
|
| typedef _ms_transaction | MSTxn |
| | Transaction information.
|
Enumerations |
| enum | MSOption { MS_OPT_LOGFILE = 1,
MS_OPT_IDFILE = 2,
MS_OPT_SERVER = 3,
MS_OPT_DBFILE = 4
} |
| | Model storage option codes. More...
|
Functions |
| MS_STORAGE_TYPE int | model_storage_batch_get (ModelStorage *ms, MSTxn *txn, Statement *mask_list, Statement **result) |
| MS_STORAGE_TYPE int | model_storage_begin_transaction (ModelStorageEnv *env, MSTxn **txn) |
| | Starts the transaction.
|
| MS_STORAGE_TYPE int | model_storage_blob_close (MSBlob *blob) |
| MS_STORAGE_TYPE int | model_storage_blob_open (ModelStorage *ms, Node *n, MSBlob **blob) |
| | Opens blob.
|
| MS_STORAGE_TYPE int | model_storage_blob_read (MSBlob *blob, void *buffer, size_t size, size_t *read) |
| | reads from blob to buffer
|
| MS_STORAGE_TYPE int | model_storage_blob_seek (MSBlob *blob, long offset) |
| MS_STORAGE_TYPE int | model_storage_blob_tell (MSBlob *blob, long *offset) |
| MS_STORAGE_TYPE int | model_storage_blob_truncate (MSBlob *blob, size_t size) |
| MS_STORAGE_TYPE int | model_storage_blob_write (MSBlob *blob, void *buffer, size_t size) |
| | writes buffer to blob
|
| MS_STORAGE_TYPE int | model_storage_commit_transaction (ModelStorage *ms, MSTxn *txn) |
| | Commits the transaction.
|
| MS_STORAGE_TYPE int | model_storage_configure (ModelStorageEnv *env, MSOption opt, void *value) |
| MS_STORAGE_TYPE void | model_storage_dump (ModelStorageEnv *env) |
| | Dumps the current model storage state into the file specified.
|
| MS_STORAGE_TYPE void | model_storage_free (ModelStorage *ms) |
| | Destroys the model storage instance.
|
| MS_STORAGE_TYPE int | model_storage_free_env (ModelStorageEnv *env) |
| | Clears the model.
|
| MS_STORAGE_TYPE int | model_storage_get (ModelStorage *ms, MSTxn *txn, Statement *mask, Statement **result) |
| | Returs a list of statements matching the given mask.
|
| MS_STORAGE_TYPE const char * | model_storage_get_context_key (ModelStorage *ms) |
| | returns the current context key of the modelstorage
|
| MS_STORAGE_TYPE int | model_storage_get_count (ModelStorage *ms, MSTxn *txn, Statement *mask, unsigned long *result_count) |
| | Estimates possible count of retuned statements matching the given mask.
|
| MS_STORAGE_TYPE ModelStorageEnv * | model_storage_get_env (ModelStorage *ms) |
| | Retruns ModelStorage Environment.
|
| MS_STORAGE_TYPE const char * | model_storage_get_filename (ModelStorageEnv *env) |
| | Returns filename.
|
| MS_STORAGE_TYPE int | model_storage_get_new_id (ModelStorage *ms, Node *idnode) |
| | Generates a new uniq identifier represented with a Node.
|
| MS_STORAGE_TYPE int | model_storage_get_time (ModelStorage *ms, time_t *time) |
| | Returns the current time slice.
|
| MS_STORAGE_TYPE int | model_storage_init_env (const char *filename, ModelStorageEnv **env) |
| | Performs initialization of common structure.
|
| MS_STORAGE_TYPE int | model_storage_init_env_se (const char *filename, int descrypt, const char *passphrase, ModelStorageEnv **env) |
| | Secure version of model_storage_init_env.
|
| MS_STORAGE_TYPE int | model_storage_n4_export (ModelStorage *ms, char *filename, MSProgress cb, void *data) |
| MS_STORAGE_TYPE int | model_storage_n4_import (ModelStorage *ms, char *filename, MSProgress cb, void *data) |
| MS_STORAGE_TYPE ModelStorage * | model_storage_new (ModelStorageEnv *env) |
| | Creates and initializes the model storage instance.
|
| MS_STORAGE_TYPE int | model_storage_restore (ModelStorageEnv *env) |
| | Loads the current model storate state from file.
|
| MS_STORAGE_TYPE int | model_storage_rollback_transaction (ModelStorage *ms, MSTxn *txn) |
| | Rolls back the current transaction on model storage.
|
| MS_STORAGE_TYPE void | model_storage_save (ModelStorageEnv *env) |
| | Saves the current state of modelstorage.
|
| MS_STORAGE_TYPE int | model_storage_save_as (ModelStorageEnv *env, const char *filename) |
| MS_STORAGE_TYPE int | model_storage_save_se (ModelStorageEnv *env, const char *passphrase) |
| | Encrypts and saves the file.
|
| MS_STORAGE_TYPE int | model_storage_set (ModelStorage *ms, MSTxn *txn, Statement *stmt) |
| | Sets the statement.
|
| MS_STORAGE_TYPE int | model_storage_set_context_key (ModelStorage *ms, const char *context_key) |
| | sets the current context_key of the model storage.
|
| MS_STORAGE_TYPE int | model_storage_set_notify (ModelStorage *ms, MSNotify cb, void *data) |
| | Sets the notify callback.
|
| MS_STORAGE_TYPE int | model_storage_set_time (ModelStorage *ms, time_t time) |
| | Sets the current time slice.
|
| MS_STORAGE_TYPE int | notification_read (ModelStorage *ms, Statement *op) |
| | Pick notification from the notification list.
|
This is the main file to be included when using modelstorage service as an embedded library.