2008-03-19 12:37:17 +01:00
/*
* Unix SMB / CIFS implementation .
* libsmbconf - Samba configuration library
* Copyright ( C ) Michael Adam 2008
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program 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 General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef __LIBSMBCONF_PRIVATE_H__
# define __LIBSMBCONF_PRIVATE_H__
2009-01-21 18:50:16 +01:00
# ifndef GLOBAL_NAME
# define GLOBAL_NAME "global"
# endif
# include "lib/smbconf/smbconf.h"
2008-03-20 12:28:41 +01:00
struct smbconf_ops {
2011-04-07 17:19:03 +02:00
sbcErr ( * init ) ( struct smbconf_ctx * ctx , const char * path ) ;
2008-03-21 02:01:55 +01:00
int ( * shutdown ) ( struct smbconf_ctx * ctx ) ;
2008-10-20 23:52:02 +02:00
bool ( * requires_messaging ) ( struct smbconf_ctx * ctx ) ;
2008-10-23 11:16:50 +02:00
bool ( * is_writeable ) ( struct smbconf_ctx * ctx ) ;
2011-04-08 10:28:17 +02:00
sbcErr ( * open_conf ) ( struct smbconf_ctx * ctx ) ;
2008-03-20 18:40:09 +01:00
int ( * close_conf ) ( struct smbconf_ctx * ctx ) ;
2008-03-20 12:28:41 +01:00
void ( * get_csn ) ( struct smbconf_ctx * ctx , struct smbconf_csn * csn ,
const char * service , const char * param ) ;
2011-04-08 10:40:02 +02:00
sbcErr ( * drop ) ( struct smbconf_ctx * ctx ) ;
2011-04-08 14:19:15 +02:00
sbcErr ( * get_share_names ) ( struct smbconf_ctx * ctx ,
2008-03-20 12:28:41 +01:00
TALLOC_CTX * mem_ctx ,
uint32_t * num_shares ,
char * * * share_names ) ;
bool ( * share_exists ) ( struct smbconf_ctx * ctx , const char * service ) ;
2011-04-08 15:48:01 +02:00
sbcErr ( * create_share ) ( struct smbconf_ctx * ctx , const char * service ) ;
2011-04-08 17:20:35 +02:00
sbcErr ( * get_share ) ( struct smbconf_ctx * ctx ,
2008-03-20 12:28:41 +01:00
TALLOC_CTX * mem_ctx ,
2008-04-22 16:31:16 +02:00
const char * servicename ,
struct smbconf_service * * service ) ;
2011-04-11 11:39:03 +02:00
sbcErr ( * delete_share ) ( struct smbconf_ctx * ctx ,
2008-03-20 12:28:41 +01:00
const char * servicename ) ;
2011-04-11 13:23:26 +02:00
sbcErr ( * set_parameter ) ( struct smbconf_ctx * ctx ,
2008-03-21 02:29:09 +01:00
const char * service ,
const char * param ,
const char * valstr ) ;
2011-04-11 13:50:53 +02:00
sbcErr ( * get_parameter ) ( struct smbconf_ctx * ctx ,
2008-03-21 02:29:09 +01:00
TALLOC_CTX * mem_ctx ,
const char * service ,
const char * param ,
char * * valstr ) ;
2011-04-11 14:20:32 +02:00
sbcErr ( * delete_parameter ) ( struct smbconf_ctx * ctx ,
2008-03-20 12:28:41 +01:00
const char * service , const char * param ) ;
2011-04-11 14:52:52 +02:00
sbcErr ( * get_includes ) ( struct smbconf_ctx * ctx ,
2008-04-08 10:16:03 +02:00
TALLOC_CTX * mem_ctx ,
2008-04-08 01:56:32 +02:00
const char * service ,
uint32_t * num_includes , char * * * includes ) ;
2011-04-11 15:14:52 +02:00
sbcErr ( * set_includes ) ( struct smbconf_ctx * ctx ,
2008-04-08 01:56:32 +02:00
const char * service ,
uint32_t num_includes , const char * * includes ) ;
2011-04-11 16:01:22 +02:00
sbcErr ( * delete_includes ) ( struct smbconf_ctx * ctx ,
2008-04-09 22:21:15 +02:00
const char * service ) ;
2011-04-11 17:24:13 +02:00
sbcErr ( * transaction_start ) ( struct smbconf_ctx * ctx ) ;
sbcErr ( * transaction_commit ) ( struct smbconf_ctx * ctx ) ;
sbcErr ( * transaction_cancel ) ( struct smbconf_ctx * ctx ) ;
2008-03-20 12:28:41 +01:00
} ;
2008-03-19 12:37:17 +01:00
struct smbconf_ctx {
2008-03-21 17:55:31 +01:00
const char * path ;
2008-03-20 12:28:41 +01:00
struct smbconf_ops * ops ;
2008-03-21 22:52:27 +01:00
void * data ; /* private data for use in backends */
2008-03-19 12:37:17 +01:00
} ;
2011-04-07 17:19:03 +02:00
sbcErr smbconf_init_internal ( TALLOC_CTX * mem_ctx , struct smbconf_ctx * * conf_ctx ,
2008-04-13 16:26:14 +02:00
const char * path , struct smbconf_ops * ops ) ;
2008-04-07 15:06:41 +02:00
2011-04-08 14:19:15 +02:00
sbcErr smbconf_add_string_to_array ( TALLOC_CTX * mem_ctx ,
2008-03-21 16:26:50 +01:00
char * * * array ,
uint32_t count ,
const char * string ) ;
2008-04-07 15:09:28 +02:00
bool smbconf_find_in_array ( const char * string , char * * list ,
uint32_t num_entries , uint32_t * entry ) ;
2008-04-08 00:03:39 +02:00
bool smbconf_reverse_find_in_array ( const char * string , char * * list ,
uint32_t num_entries , uint32_t * entry ) ;
2008-03-19 12:37:17 +01:00
# endif