aboutsummaryrefslogtreecommitdiffstats
path: root/svm/svmdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'svm/svmdb.h')
-rw-r--r--svm/svmdb.h134
1 files changed, 74 insertions, 60 deletions
diff --git a/svm/svmdb.h b/svm/svmdb.h
index c5f59bbdd82..5f44b33280d 100644
--- a/svm/svmdb.h
+++ b/svm/svmdb.h
@@ -1,4 +1,4 @@
-/*
+/*
*------------------------------------------------------------------
* svmdb.h - shared VM database
*
@@ -22,60 +22,67 @@
#include "svm.h"
-typedef enum {
- SVMDB_ACTION_ILLEGAL=0,
- SVMDB_ACTION_GET, /* not clear why anyone would care */
- SVMDB_ACTION_SET,
- SVMDB_ACTION_UNSET,
+typedef enum
+{
+ SVMDB_ACTION_ILLEGAL = 0,
+ SVMDB_ACTION_GET, /* not clear why anyone would care */
+ SVMDB_ACTION_SET,
+ SVMDB_ACTION_UNSET,
} svmdb_action_t;
-typedef struct {
- int pid;
- int signum;
- u32 action:4;
- u32 opaque:28;
+typedef struct
+{
+ int pid;
+ int signum;
+ u32 action:4;
+ u32 opaque:28;
} svmdb_notify_t;
-typedef struct {
- u8 *value;
- svmdb_notify_t *notifications;
- u32 elsize;
+typedef struct
+{
+ u8 *value;
+ svmdb_notify_t *notifications;
+ u32 elsize;
} svmdb_value_t;
-typedef enum {
- SVMDB_NAMESPACE_STRING=0,
- SVMDB_NAMESPACE_VEC,
- SVMDB_N_NAMESPACES,
+typedef enum
+{
+ SVMDB_NAMESPACE_STRING = 0,
+ SVMDB_NAMESPACE_VEC,
+ SVMDB_N_NAMESPACES,
} svmdb_namespace_t;
-typedef struct {
- uword version;
- /* pool of values */
- svmdb_value_t *values;
- uword *namespaces [SVMDB_N_NAMESPACES];
+typedef struct
+{
+ uword version;
+ /* pool of values */
+ svmdb_value_t *values;
+ uword *namespaces[SVMDB_N_NAMESPACES];
} svmdb_shm_hdr_t;
#define SVMDB_SHM_VERSION 2
-typedef struct {
- int flags;
- int pid;
- svm_region_t *db_rp;
- svmdb_shm_hdr_t *shm;
-} svmdb_client_t;
-
-typedef struct {
- int add_del;
- svmdb_namespace_t nspace;
- char *var;
- u32 elsize;
- int signum;
- u32 action:4;
- u32 opaque:28;
+typedef struct
+{
+ int flags;
+ int pid;
+ svm_region_t *db_rp;
+ svmdb_shm_hdr_t *shm;
+} svmdb_client_t;
+
+typedef struct
+{
+ int add_del;
+ svmdb_namespace_t nspace;
+ char *var;
+ u32 elsize;
+ int signum;
+ u32 action:4;
+ u32 opaque:28;
} svmdb_notification_args_t;
-/*
- * Must be a reasonable number, several mb smaller than
+/*
+ * Must be a reasonable number, several mb smaller than
* SVM_GLOBAL_REGION_SIZE, or no donut for you...
*/
#define SVMDB_DEFAULT_SIZE (4<<20)
@@ -88,28 +95,35 @@ svmdb_client_t *svmdb_map_chroot (char *root_path);
svmdb_client_t *svmdb_map_chroot_size (char *root_path, uword size);
-void svmdb_unmap (svmdb_client_t *client);
-void svmdb_local_unset_string_variable (svmdb_client_t *client, char *var);
-void svmdb_local_set_string_variable (svmdb_client_t *client,
- char *var, char *val);
-char *svmdb_local_get_string_variable (svmdb_client_t *client, char *var);
-void *svmdb_local_get_variable_reference (svmdb_client_t *client,
- svmdb_namespace_t ns,
- char *var);
+void svmdb_unmap (svmdb_client_t * client);
+void svmdb_local_unset_string_variable (svmdb_client_t * client, char *var);
+void svmdb_local_set_string_variable (svmdb_client_t * client,
+ char *var, char *val);
+char *svmdb_local_get_string_variable (svmdb_client_t * client, char *var);
+void *svmdb_local_get_variable_reference (svmdb_client_t * client,
+ svmdb_namespace_t ns, char *var);
-void svmdb_local_dump_strings (svmdb_client_t *client);
+void svmdb_local_dump_strings (svmdb_client_t * client);
-void svmdb_local_unset_vec_variable (svmdb_client_t *client, char *var);
-void svmdb_local_set_vec_variable (svmdb_client_t *client,
- char *var, void *val, u32 elsize);
-void *svmdb_local_get_vec_variable (svmdb_client_t *client, char *var,
- u32 elsize);
-void svmdb_local_dump_vecs (svmdb_client_t *client);
+void svmdb_local_unset_vec_variable (svmdb_client_t * client, char *var);
+void svmdb_local_set_vec_variable (svmdb_client_t * client,
+ char *var, void *val, u32 elsize);
+void *svmdb_local_get_vec_variable (svmdb_client_t * client, char *var,
+ u32 elsize);
+void svmdb_local_dump_vecs (svmdb_client_t * client);
-int svmdb_local_add_del_notification (svmdb_client_t *client,
- svmdb_notification_args_t *args);
+int svmdb_local_add_del_notification (svmdb_client_t * client,
+ svmdb_notification_args_t * args);
-void *svmdb_local_find_or_add_vec_variable (svmdb_client_t *client,
- char *var, u32 nbytes);
+void *svmdb_local_find_or_add_vec_variable (svmdb_client_t * client,
+ char *var, u32 nbytes);
#endif /* __included_svmdb_h__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */