/usr/include/libgda-4.0/libgda/gda-server-operation.h is in libgda-4.0-dev 4.2.8-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | /* GDA library
* Copyright (C) 2006 - 2009 The GNOME Foundation.
*
* AUTHORS:
* Vivien Malerba <malerba@gnome-db.org>
* Daniel Espinosa <esodan@gmail.com>
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this Library; see the file COPYING.LIB. If not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDA_SERVER_OPERATION_H__
#define __GDA_SERVER_OPERATION_H__
#include <glib-object.h>
#include <libgda/gda-decl.h>
#include <libxml/tree.h>
G_BEGIN_DECLS
#define GDA_TYPE_SERVER_OPERATION (gda_server_operation_get_type())
#define GDA_SERVER_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GDA_TYPE_SERVER_OPERATION, GdaServerOperation))
#define GDA_SERVER_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, GDA_TYPE_SERVER_OPERATION, GdaServerOperationClass))
#define GDA_IS_SERVER_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GDA_TYPE_SERVER_OPERATION))
#define GDA_IS_SERVER_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GDA_TYPE_SERVER_OPERATION))
/*
* Types of identified operations
* all the providers don't implement them completely, though
*/
typedef enum {
GDA_SERVER_OPERATION_CREATE_DB,
GDA_SERVER_OPERATION_DROP_DB,
GDA_SERVER_OPERATION_CREATE_TABLE,
GDA_SERVER_OPERATION_DROP_TABLE,
GDA_SERVER_OPERATION_RENAME_TABLE,
GDA_SERVER_OPERATION_ADD_COLUMN,
GDA_SERVER_OPERATION_DROP_COLUMN,
GDA_SERVER_OPERATION_CREATE_INDEX,
GDA_SERVER_OPERATION_DROP_INDEX,
GDA_SERVER_OPERATION_CREATE_VIEW,
GDA_SERVER_OPERATION_DROP_VIEW,
GDA_SERVER_OPERATION_COMMENT_TABLE,
GDA_SERVER_OPERATION_COMMENT_COLUMN,
GDA_SERVER_OPERATION_CREATE_USER,
GDA_SERVER_OPERATION_ALTER_USER,
GDA_SERVER_OPERATION_DROP_USER,
GDA_SERVER_OPERATION_LAST
} GdaServerOperationType;
/* error reporting */
extern GQuark gda_server_operation_error_quark (void);
#define GDA_SERVER_OPERATION_ERROR gda_server_operation_error_quark ()
typedef enum {
GDA_SERVER_OPERATION_OBJECT_NAME_ERROR,
GDA_SERVER_OPERATION_INCORRECT_VALUE_ERROR
} GdaServerOperationError;
typedef enum
{
GDA_SERVER_OPERATION_CREATE_TABLE_NOTHING_FLAG = 1 << 0,
GDA_SERVER_OPERATION_CREATE_TABLE_PKEY_FLAG = 1 << 1,
GDA_SERVER_OPERATION_CREATE_TABLE_NOT_NULL_FLAG = 1 << 2,
GDA_SERVER_OPERATION_CREATE_TABLE_UNIQUE_FLAG = 1 << 3,
GDA_SERVER_OPERATION_CREATE_TABLE_AUTOINC_FLAG = 1 << 4,
GDA_SERVER_OPERATION_CREATE_TABLE_FKEY_FLAG = 1 << 5,
/* Flags combinations */
GDA_SERVER_OPERATION_CREATE_TABLE_PKEY_AUTOINC_FLAG = GDA_SERVER_OPERATION_CREATE_TABLE_PKEY_FLAG | GDA_SERVER_OPERATION_CREATE_TABLE_AUTOINC_FLAG
} GdaServerOperationCreateTableFlag;
typedef enum {
GDA_SERVER_OPERATION_NODE_PARAMLIST,
GDA_SERVER_OPERATION_NODE_DATA_MODEL,
GDA_SERVER_OPERATION_NODE_PARAM,
GDA_SERVER_OPERATION_NODE_SEQUENCE,
GDA_SERVER_OPERATION_NODE_SEQUENCE_ITEM,
GDA_SERVER_OPERATION_NODE_DATA_MODEL_COLUMN,
GDA_SERVER_OPERATION_NODE_UNKNOWN
} GdaServerOperationNodeType;
typedef enum {
GDA_SERVER_OPERATION_STATUS_OPTIONAL,
GDA_SERVER_OPERATION_STATUS_REQUIRED,
GDA_SERVER_OPERATION_STATUS_UNKNOWN
} GdaServerOperationNodeStatus;
typedef struct _GdaServerOperationNode {
GdaServerOperationNodeType type;
GdaServerOperationNodeStatus status;
GdaSet *plist;
GdaDataModel *model;
GdaColumn *column;
GdaHolder *param;
gpointer priv;
} GdaServerOperationNode;
struct _GdaServerOperation {
GObject object;
GdaServerOperationPrivate *priv;
};
struct _GdaServerOperationClass {
GObjectClass parent_class;
/* signals */
void (*seq_item_added) (GdaServerOperation *op, const gchar *seq_path, gint item_index);
void (*seq_item_remove) (GdaServerOperation *op, const gchar *seq_path, gint item_index);
/* Padding for future expansion */
void (*_gda_reserved1) (void);
void (*_gda_reserved2) (void);
void (*_gda_reserved3) (void);
void (*_gda_reserved4) (void);
};
GType gda_server_operation_get_type (void) G_GNUC_CONST;
GdaServerOperation *gda_server_operation_new (GdaServerOperationType op_type, const gchar *xml_file);
GdaServerOperationType gda_server_operation_get_op_type (GdaServerOperation *op);
const gchar *gda_server_operation_op_type_to_string (GdaServerOperationType type);
GdaServerOperationType gda_server_operation_string_to_op_type (const gchar *str);
GdaServerOperationNode *gda_server_operation_get_node_info (GdaServerOperation *op, const gchar *path_format, ...);
const GValue *gda_server_operation_get_value_at (GdaServerOperation *op, const gchar *path_format, ...);
const GValue *gda_server_operation_get_value_at_path (GdaServerOperation *op, const gchar *path);
gchar *gda_server_operation_get_sql_identifier_at (GdaServerOperation *op,
GdaConnection *cnc, GdaServerProvider *prov,
const gchar *path_format, ...);
gchar *gda_server_operation_get_sql_identifier_at_path (GdaServerOperation *op,
GdaConnection *cnc, GdaServerProvider *prov,
const gchar *path);
gboolean gda_server_operation_set_value_at (GdaServerOperation *op, const gchar *value,
GError **error, const gchar *path_format, ...);
gboolean gda_server_operation_set_value_at_path (GdaServerOperation *op, const gchar *value,
const gchar *path, GError **error);
xmlNodePtr gda_server_operation_save_data_to_xml (GdaServerOperation *op, GError **error);
gboolean gda_server_operation_load_data_from_xml (GdaServerOperation *op,
xmlNodePtr node, GError **error);
gchar** gda_server_operation_get_root_nodes (GdaServerOperation *op);
GdaServerOperationNodeType gda_server_operation_get_node_type (GdaServerOperation *op, const gchar *path,
GdaServerOperationNodeStatus *status);
gchar *gda_server_operation_get_node_parent (GdaServerOperation *op, const gchar *path);
gchar *gda_server_operation_get_node_path_portion (GdaServerOperation *op, const gchar *path);
const gchar *gda_server_operation_get_sequence_name (GdaServerOperation *op, const gchar *path);
guint gda_server_operation_get_sequence_size (GdaServerOperation *op, const gchar *path);
guint gda_server_operation_get_sequence_max_size (GdaServerOperation *op, const gchar *path);
guint gda_server_operation_get_sequence_min_size (GdaServerOperation *op, const gchar *path);
gchar **gda_server_operation_get_sequence_item_names (GdaServerOperation *op, const gchar *path);
guint gda_server_operation_add_item_to_sequence (GdaServerOperation *op, const gchar *seq_path);
gboolean gda_server_operation_del_item_from_sequence (GdaServerOperation *op, const gchar *item_path);
gboolean gda_server_operation_is_valid (GdaServerOperation *op, const gchar *xml_file, GError **error);
/*
* Database creation and destruction
*/
GdaServerOperation *gda_server_operation_prepare_create_database (const gchar *provider, const gchar *db_name, GError **error);
gboolean gda_server_operation_perform_create_database (GdaServerOperation *op, const gchar *provider, GError **error);
GdaServerOperation *gda_server_operation_prepare_drop_database (const gchar *provider, const gchar *db_name, GError **error);
gboolean gda_server_operation_perform_drop_database (GdaServerOperation *op, const gchar *provider, GError **error);
/*
* Tables creation and destruction
*/
GdaServerOperation *gda_server_operation_prepare_create_table (GdaConnection *cnc, const gchar *table_name, GError **error, ...);
gboolean gda_server_operation_perform_create_table (GdaServerOperation *op, GError **error);
GdaServerOperation *gda_server_operation_prepare_drop_table (GdaConnection *cnc, const gchar *table_name, GError **error);
gboolean gda_server_operation_perform_drop_table (GdaServerOperation *op, GError **error);
G_END_DECLS
#endif
|