JULEA
Data Structures | Macros | Typedefs | Enumerations | Functions
jbackend.h File Reference
#include <glib.h>
#include <gmodule.h>
#include <bson.h>
#include <core/jsemantics.h>

Go to the source code of this file.

Data Structures

struct  JBackend
 

Macros

#define J_BACKEND_BSON_ERROR   j_backend_bson_error_quark()
 
#define J_BACKEND_DB_ERROR   j_backend_db_error_quark()
 
#define J_BACKEND_SQL_ERROR   j_backend_sql_error_quark()
 

Typedefs

typedef enum JBackendBSONError JBackendBSONError
 
typedef enum JBackendDBError JBackendDBError
 
typedef enum JBackendSQLError JBackendSQLError
 
typedef enum JBackendType JBackendType
 
typedef enum JBackendComponent JBackendComponent
 
typedef enum JBackendFlags JBackendFlags
 
typedef struct JBackend JBackend
 

Enumerations

enum  JBackendBSONError {
  J_BACKEND_BSON_ERROR_FAILED , J_BACKEND_BSON_ERROR_BSON_APPEND_ARRAY_FAILED , J_BACKEND_BSON_ERROR_BSON_APPEND_DOCUMENT_FAILED , J_BACKEND_BSON_ERROR_BSON_APPEND_FAILED ,
  J_BACKEND_BSON_ERROR_BSON_BUF_NULL , J_BACKEND_BSON_ERROR_BSON_COUNT_NULL , J_BACKEND_BSON_ERROR_BSON_HAS_FIELD_NULL , J_BACKEND_BSON_ERROR_BSON_INIT_FROM_JSON_FAILED ,
  J_BACKEND_BSON_ERROR_BSON_JSON_NULL , J_BACKEND_BSON_ERROR_BSON_NAME_NULL , J_BACKEND_BSON_ERROR_BSON_NOT_ENOUGH_KEYS , J_BACKEND_BSON_ERROR_BSON_NULL ,
  J_BACKEND_BSON_ERROR_BSON_VALUE_NULL , J_BACKEND_BSON_ERROR_ITER_EQUALS_NULL , J_BACKEND_BSON_ERROR_ITER_HAS_NEXT_NULL , J_BACKEND_BSON_ERROR_ITER_INIT ,
  J_BACKEND_BSON_ERROR_ITER_INVALID_TYPE , J_BACKEND_BSON_ERROR_ITER_KEY_FOUND , J_BACKEND_BSON_ERROR_ITER_KEY_NOT_FOUND , J_BACKEND_BSON_ERROR_ITER_KEY_NULL ,
  J_BACKEND_BSON_ERROR_ITER_NULL , J_BACKEND_BSON_ERROR_ITER_RECOURSE , J_BACKEND_BSON_ERROR_ITER_TYPE_NULL
}
 
enum  JBackendDBError {
  J_BACKEND_DB_ERROR_FAILED , J_BACKEND_DB_ERROR_COMPARATOR_INVALID , J_BACKEND_DB_ERROR_DB_TYPE_INVALID , J_BACKEND_DB_ERROR_ITERATOR_INVALID ,
  J_BACKEND_DB_ERROR_ITERATOR_NO_MORE_ELEMENTS , J_BACKEND_DB_ERROR_NO_VARIABLE_SET , J_BACKEND_DB_ERROR_OPERATOR_INVALID , J_BACKEND_DB_ERROR_SCHEMA_EMPTY ,
  J_BACKEND_DB_ERROR_SCHEMA_NOT_FOUND , J_BACKEND_DB_ERROR_SELECTOR_EMPTY , J_BACKEND_DB_ERROR_THREADING_ERROR , J_BACKEND_DB_ERROR_VARIABLE_NOT_FOUND
}
 
enum  JBackendSQLError {
  J_BACKEND_SQL_ERROR_FAILED , J_BACKEND_SQL_ERROR_BIND , J_BACKEND_SQL_ERROR_CONSTRAINT , J_BACKEND_SQL_ERROR_FINALIZE ,
  J_BACKEND_SQL_ERROR_INVALID_TYPE , J_BACKEND_SQL_ERROR_PREPARE , J_BACKEND_SQL_ERROR_RESET , J_BACKEND_SQL_ERROR_STEP
}
 
enum  JBackendType { J_BACKEND_TYPE_OBJECT , J_BACKEND_TYPE_KV , J_BACKEND_TYPE_DB }
 
enum  JBackendComponent { J_BACKEND_COMPONENT_CLIENT , J_BACKEND_COMPONENT_SERVER }
 
enum  JBackendFlags { J_BACKEND_FLAGS_DO_NOT_UNLOAD = 1 << 0 }
 

Functions

GQuark j_backend_bson_error_quark (void)
 
GQuark j_backend_db_error_quark (void)
 
GQuark j_backend_sql_error_quark (void)
 
JBackendbackend_info (void)
 
gboolean j_backend_load (gchar const *, JBackendComponent, JBackendType, GModule **, JBackend **)
 
gboolean j_backend_unload (JBackend *, GModule *)
 
gboolean j_backend_object_init (JBackend *, gchar const *)
 
void j_backend_object_fini (JBackend *)
 
gboolean j_backend_object_create (JBackend *, gchar const *, gchar const *, gpointer *)
 
gboolean j_backend_object_open (JBackend *, gchar const *, gchar const *, gpointer *)
 
gboolean j_backend_object_delete (JBackend *, gpointer)
 
gboolean j_backend_object_close (JBackend *, gpointer)
 
gboolean j_backend_object_status (JBackend *, gpointer, gint64 *, guint64 *)
 
gboolean j_backend_object_sync (JBackend *, gpointer)
 
gboolean j_backend_object_read (JBackend *, gpointer, gpointer, guint64, guint64, guint64 *)
 
gboolean j_backend_object_write (JBackend *, gpointer, gconstpointer, guint64, guint64, guint64 *)
 
gboolean j_backend_object_get_all (JBackend *, gchar const *, gpointer *)
 
gboolean j_backend_object_get_by_prefix (JBackend *, gchar const *, gchar const *, gpointer *)
 
gboolean j_backend_object_iterate (JBackend *, gpointer, gchar const **)
 
gboolean j_backend_kv_init (JBackend *, gchar const *)
 
void j_backend_kv_fini (JBackend *)
 
gboolean j_backend_kv_batch_start (JBackend *, gchar const *, JSemantics *, gpointer *)
 
gboolean j_backend_kv_batch_execute (JBackend *, gpointer)
 
gboolean j_backend_kv_put (JBackend *, gpointer, gchar const *, gconstpointer, guint32)
 
gboolean j_backend_kv_delete (JBackend *, gpointer, gchar const *)
 
gboolean j_backend_kv_get (JBackend *, gpointer, gchar const *, gpointer *, guint32 *)
 
gboolean j_backend_kv_get_all (JBackend *, gchar const *, gpointer *)
 
gboolean j_backend_kv_get_by_prefix (JBackend *, gchar const *, gchar const *, gpointer *)
 
gboolean j_backend_kv_iterate (JBackend *, gpointer, gchar const **, gconstpointer *, guint32 *)
 
gboolean j_backend_db_init (JBackend *, gchar const *)
 
void j_backend_db_fini (JBackend *)
 
gboolean j_backend_db_batch_start (JBackend *, gchar const *, JSemantics *, gpointer *, GError **)
 
gboolean j_backend_db_batch_execute (JBackend *, gpointer, GError **)
 
gboolean j_backend_db_schema_create (JBackend *, gpointer, gchar const *, bson_t const *, GError **)
 
gboolean j_backend_db_schema_get (JBackend *, gpointer, gchar const *, bson_t *, GError **)
 
gboolean j_backend_db_schema_delete (JBackend *, gpointer, gchar const *, GError **)
 
gboolean j_backend_db_insert (JBackend *, gpointer, gchar const *, bson_t const *, bson_t *, GError **)
 
gboolean j_backend_db_update (JBackend *, gpointer, gchar const *, bson_t const *, bson_t const *, GError **)
 
gboolean j_backend_db_delete (JBackend *, gpointer, gchar const *, bson_t const *, GError **)
 
gboolean j_backend_db_query (JBackend *, gpointer, gchar const *, bson_t const *, gpointer *, GError **)
 
gboolean j_backend_db_iterate (JBackend *, gpointer, bson_t *, GError **)
 

Macro Definition Documentation

◆ J_BACKEND_BSON_ERROR

#define J_BACKEND_BSON_ERROR   j_backend_bson_error_quark()

◆ J_BACKEND_DB_ERROR

#define J_BACKEND_DB_ERROR   j_backend_db_error_quark()

◆ J_BACKEND_SQL_ERROR

#define J_BACKEND_SQL_ERROR   j_backend_sql_error_quark()

Typedef Documentation

◆ JBackend

typedef struct JBackend JBackend

◆ JBackendBSONError

◆ JBackendComponent

◆ JBackendDBError

◆ JBackendFlags

◆ JBackendSQLError

◆ JBackendType

typedef enum JBackendType JBackendType

Enumeration Type Documentation

◆ JBackendBSONError

Todo:
does it make sense to report these errors?
Enumerator
J_BACKEND_BSON_ERROR_FAILED 
J_BACKEND_BSON_ERROR_BSON_APPEND_ARRAY_FAILED 
J_BACKEND_BSON_ERROR_BSON_APPEND_DOCUMENT_FAILED 
J_BACKEND_BSON_ERROR_BSON_APPEND_FAILED 
J_BACKEND_BSON_ERROR_BSON_BUF_NULL 
J_BACKEND_BSON_ERROR_BSON_COUNT_NULL 
J_BACKEND_BSON_ERROR_BSON_HAS_FIELD_NULL 
J_BACKEND_BSON_ERROR_BSON_INIT_FROM_JSON_FAILED 
J_BACKEND_BSON_ERROR_BSON_JSON_NULL 
J_BACKEND_BSON_ERROR_BSON_NAME_NULL 
J_BACKEND_BSON_ERROR_BSON_NOT_ENOUGH_KEYS 
J_BACKEND_BSON_ERROR_BSON_NULL 
J_BACKEND_BSON_ERROR_BSON_VALUE_NULL 
J_BACKEND_BSON_ERROR_ITER_EQUALS_NULL 
J_BACKEND_BSON_ERROR_ITER_HAS_NEXT_NULL 
J_BACKEND_BSON_ERROR_ITER_INIT 
J_BACKEND_BSON_ERROR_ITER_INVALID_TYPE 
J_BACKEND_BSON_ERROR_ITER_KEY_FOUND 
J_BACKEND_BSON_ERROR_ITER_KEY_NOT_FOUND 
J_BACKEND_BSON_ERROR_ITER_KEY_NULL 
J_BACKEND_BSON_ERROR_ITER_NULL 
J_BACKEND_BSON_ERROR_ITER_RECOURSE 
J_BACKEND_BSON_ERROR_ITER_TYPE_NULL 

◆ JBackendComponent

Enumerator
J_BACKEND_COMPONENT_CLIENT 
J_BACKEND_COMPONENT_SERVER 

◆ JBackendDBError

Enumerator
J_BACKEND_DB_ERROR_FAILED 
J_BACKEND_DB_ERROR_COMPARATOR_INVALID 
J_BACKEND_DB_ERROR_DB_TYPE_INVALID 
J_BACKEND_DB_ERROR_ITERATOR_INVALID 
J_BACKEND_DB_ERROR_ITERATOR_NO_MORE_ELEMENTS 
J_BACKEND_DB_ERROR_NO_VARIABLE_SET 
J_BACKEND_DB_ERROR_OPERATOR_INVALID 
J_BACKEND_DB_ERROR_SCHEMA_EMPTY 
J_BACKEND_DB_ERROR_SCHEMA_NOT_FOUND 
J_BACKEND_DB_ERROR_SELECTOR_EMPTY 
J_BACKEND_DB_ERROR_THREADING_ERROR 
J_BACKEND_DB_ERROR_VARIABLE_NOT_FOUND 

◆ JBackendFlags

Enumerator
J_BACKEND_FLAGS_DO_NOT_UNLOAD 

◆ JBackendSQLError

Enumerator
J_BACKEND_SQL_ERROR_FAILED 
J_BACKEND_SQL_ERROR_BIND 
J_BACKEND_SQL_ERROR_CONSTRAINT 
J_BACKEND_SQL_ERROR_FINALIZE 
J_BACKEND_SQL_ERROR_INVALID_TYPE 
J_BACKEND_SQL_ERROR_PREPARE 
J_BACKEND_SQL_ERROR_RESET 
J_BACKEND_SQL_ERROR_STEP 

◆ JBackendType

Enumerator
J_BACKEND_TYPE_OBJECT 
J_BACKEND_TYPE_KV 
J_BACKEND_TYPE_DB 

Function Documentation

◆ backend_info()

JBackend* backend_info ( void  )