dsalib.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifndef __dsalib_h
  39. #define __dsalib_h
  40. #include <stdio.h>
  41. #include <time.h>
  42. #include <stdarg.h>
  43. #ifdef HPUX
  44. #include <limits.h> /* for PATH_MAX */
  45. #endif
  46. /* error types */
  47. #define DS_FILE_ERROR 0
  48. #define DS_MEMORY_ERROR 1
  49. #define DS_SYSTEM_ERROR 2
  50. #define DS_INCORRECT_USAGE 3
  51. #define DS_ELEM_MISSING 4
  52. #define DS_REGISTRY_DATABASE_ERROR 5
  53. #define DS_NETWORK_ERROR 6
  54. #define DS_GENERAL_FAILURE 7
  55. #define DS_WARNING 8
  56. /* The upper bound on error types */
  57. #define DS_MAX_ERROR 9
  58. /* The default error type (in case something goes wrong */
  59. #define DS_DEFAULT_ERROR 3
  60. #ifndef BIG_LINE
  61. #define BIG_LINE 1024
  62. #endif
  63. #ifndef PATH_MAX
  64. #if defined( _WIN32 )
  65. #define PATH_MAX _MAX_PATH
  66. #else
  67. #define PATH_MAX 256
  68. #endif /* _WIN32 */
  69. #endif /* PATH_MAX */
  70. #ifndef HTML_ERRCOLOR
  71. #define HTML_ERRCOLOR "#AA0000"
  72. #endif
  73. #ifndef CONTENT_NAME
  74. #define CONTENT_NAME "content"
  75. #endif
  76. #ifdef XP_UNIX
  77. #define FILE_PATHSEP '/'
  78. #define FILE_PATHSEPP "/"
  79. #define FILE_PARENT "../"
  80. #define WSACleanup()
  81. #elif defined(XP_WIN32)
  82. #define FILE_PATHSEP '/'
  83. #define FILE_PATHSEPP "\\\\"
  84. #define FILE_PARENT "..\\"
  85. #endif /* XP_WIN32 */
  86. #define PATH_SIZE 1024
  87. #define ERR_SIZE 8192
  88. /*
  89. NT doesn't strictly need these, but the libadmin API which is emulated
  90. below uses them.
  91. */
  92. #define NEWSCRIPT_MODE 0755
  93. #define NEWFILE_MODE 0644
  94. #define NEWDIR_MODE 0755
  95. #if defined( XP_WIN32 )
  96. #define DS_EXPORT_SYMBOL __declspec( dllexport )
  97. #else
  98. #define DS_EXPORT_SYMBOL
  99. #endif
  100. #if defined( XP_WIN32 )
  101. #define ENQUOTE "\""
  102. #else
  103. #define ENQUOTE ""
  104. #endif
  105. #ifndef FILE_SEP
  106. #ifdef XP_WIN32
  107. #define FILE_SEP '\\'
  108. #else
  109. #define FILE_SEP '/'
  110. #endif
  111. #endif
  112. #if defined( XP_WIN32 )
  113. #define PATH_FOR_PLATFORM(_path) ds_unixtodospath(_path)
  114. #else
  115. #define PATH_FOR_PLATFORM(_path)
  116. #endif
  117. #define START_SCRIPT "start-slapd"
  118. #define RESTART_SCRIPT "restart-slapd"
  119. #define STOP_SCRIPT "stop-slapd"
  120. #if defined( XP_WIN32 )
  121. #define SLAPD_NAME "slapd"
  122. #else
  123. #define SLAPD_NAME "ns-slapd"
  124. #endif
  125. #define MOCHA_NAME "JavaScript"
  126. /*
  127. * Return values from ds_get_updown_status()
  128. */
  129. #define DS_SERVER_UP 1
  130. #define DS_SERVER_DOWN 0
  131. #define DS_SERVER_UNKNOWN -1
  132. /*
  133. * Return values from ds_bring_up_server()
  134. */
  135. #define DS_SERVER_ALREADY_UP -2
  136. #define DS_SERVER_ALREADY_DOWN -3
  137. #define DS_SERVER_PORT_IN_USE -4
  138. #define DS_SERVER_MAX_SEMAPHORES -5
  139. #define DS_SERVER_CORRUPTED_DB -6
  140. #define DS_SERVER_NO_RESOURCES -7
  141. #define DS_SERVER_COULD_NOT_START -8
  142. /*
  143. * Other return values
  144. */
  145. #define DS_UNKNOWN_ERROR -1
  146. #define DS_NO_SERVER_ROOT -10
  147. #define DS_CANNOT_EXEC -11
  148. #define DS_CANNOT_OPEN_STAT_FILE -12
  149. #define DS_NULL_PARAMETER -13
  150. #define DS_SERVER_MUST_BE_DOWN -14
  151. #define DS_CANNOT_OPEN_BACKUP_FILE -15
  152. #define DS_NOT_A_DIRECTORY -16
  153. #define DS_CANNOT_CREATE_DIRECTORY -17
  154. #define DS_CANNOT_OPEN_LDIF_FILE -18
  155. #define DS_IS_A_DIRECTORY -19
  156. #define DS_CANNOT_CREATE_FILE -20
  157. #define DS_UNDEFINED_VARIABLE -21
  158. #define DS_NO_SUCH_FILE -22
  159. #define DS_CANNOT_DELETE_FILE -23
  160. #define DS_UNKNOWN_SNMP_COMMAND -24
  161. #define DS_NON_NUMERIC_VALUE -25
  162. #define DS_NO_LOGFILE_NAME -26
  163. #define DS_CANNOT_OPEN_LOG_FILE -27
  164. #define DS_HAS_TOBE_READONLY_MODE -28
  165. #define DS_INVALID_LDIF_FILE -29
  166. /*
  167. * Types of config files.
  168. */
  169. #define DS_REAL_CONFIG 1
  170. #define DS_TMP_CONFIG 2
  171. /*
  172. * Maximum numeric value we will accept in admin interface
  173. * We may at some point need per-option bounds, but for now,
  174. * there's just one global maximum.
  175. */
  176. #define DS_MAX_NUMERIC_VALUE 4294967295 /* 2^32 - 1 */
  177. /* Use our own macro for rpt_err, so we can put our own error code in
  178. NMC_STATUS */
  179. #undef rpt_err
  180. #define rpt_err(CODE, STR1, STR2, STR3) \
  181. fprintf( stdout, "NMC_ErrInfo: %s\n", (STR1) ); \
  182. fprintf( stdout, "NMC_STATUS: %d\n", CODE )
  183. /*
  184. * Flags for ds_display_config()
  185. */
  186. #define DS_DISP_HRB 1 /* horizontal line to begin with */
  187. #define DS_DISP_HRE 2 /* horizontal line to end with */
  188. #define DS_DISP_TB 4 /* table begin */
  189. #define DS_DISP_TE 8 /* table end */
  190. #define DS_DISP_EOL 16 /* End Of Line */
  191. #define DS_DISP_NOMT 32 /* display only non empty */
  192. #define DS_DISP_NOIN 64 /* display with no input field */
  193. #define DS_DISP_HELP 128 /* display with a help button */
  194. #define DS_DISP_PLAIN 256 /* No table, no nothin */
  195. #define DS_SIMPLE (DS_DISP_EOL | DS_DISP_NOIN | DS_DISP_HELP)
  196. /*
  197. * dci_type for ds_cfg_info
  198. */
  199. #define DS_ATTR_STRING 1
  200. #define DS_ATTR_NUMBER 2
  201. #define DS_ATTR_ONOFF 3
  202. #define DS_ATTR_LIMIT 4 /* a number where -1 is displayed as blank */
  203. struct ds_cfg_info {
  204. char *dci_varname;
  205. char *dci_display;
  206. int dci_type;
  207. char *dci_help;
  208. };
  209. extern struct ds_cfg_info ds_cfg_info[];
  210. #define LDBM_DATA_SIZE 5
  211. /*ldbm specific backend information*/
  212. struct ldbm_data {
  213. char *tv[LDBM_DATA_SIZE][2]; /*type and value*/
  214. };
  215. /*
  216. * varname for ds_showparam()
  217. * NOTE: these must be kept in synch with the ds_cfg_info array defined
  218. * in ../lib/dsalib_conf.c
  219. */
  220. #define DS_LOGLEVEL 0
  221. #define DS_REFERRAL 1
  222. #define DS_AUDITFILE 2
  223. #define DS_LOCALHOST 3
  224. #define DS_PORT 4
  225. #define DS_SECURITY 5
  226. #define DS_SECURE_PORT 6
  227. #define DS_SSL3CIPHERS 7
  228. #define DS_PASSWDHASH 8
  229. #define DS_ACCESSLOG 9
  230. #define DS_ERRORLOG 10
  231. #define DS_ROOTDN 11
  232. #define DS_ROOTPW 12
  233. #define DS_SUFFIX 13
  234. #define DS_LOCALUSER 14
  235. #define DS_CFG_MAX 15 /* MUST be one greater than the last option */
  236. /* These control how long we wait for the server to start up or shutdown */
  237. #define SERVER_START_TIMEOUT 600 /* seconds */
  238. #define SERVER_STOP_TIMEOUT SERVER_START_TIMEOUT /* same as start timeout */
  239. typedef int (*DS_RM_RF_ERR_FUNC)(const char *path, const char *op, void *arg);
  240. #ifdef __cplusplus
  241. extern "C" {
  242. #endif /* __cplusplus */
  243. extern DS_EXPORT_SYMBOL char *ds_get_server_root();
  244. extern DS_EXPORT_SYMBOL char *ds_get_install_root();
  245. extern DS_EXPORT_SYMBOL char *ds_get_admserv_based_root();
  246. extern DS_EXPORT_SYMBOL void ds_log_debug_message(char *msg);
  247. extern DS_EXPORT_SYMBOL void ds_log_env(char **envp);
  248. extern DS_EXPORT_SYMBOL int ds_get_updown_status();
  249. extern DS_EXPORT_SYMBOL void ds_print_startstop(int stop);
  250. extern DS_EXPORT_SYMBOL int ds_bring_up_server_install(int verbose,
  251. char *root, char *errorlog);
  252. extern DS_EXPORT_SYMBOL int ds_bring_up_server(int verbose);
  253. extern DS_EXPORT_SYMBOL char *ds_get_server_name();
  254. extern DS_EXPORT_SYMBOL void ds_send_error(char *errstr, int print_errno);
  255. extern DS_EXPORT_SYMBOL void ds_send_status(char *str);
  256. extern DS_EXPORT_SYMBOL char *ds_get_cgi_var(char *cgi_var_name);
  257. extern DS_EXPORT_SYMBOL char *ds_get_cgi_var_simple(int index);
  258. extern DS_EXPORT_SYMBOL char *ds_get_cgi_multiple(char *cgi_var_name);
  259. extern DS_EXPORT_SYMBOL char *ds_get_errors_name();
  260. extern DS_EXPORT_SYMBOL char *ds_get_access_name();
  261. extern DS_EXPORT_SYMBOL char *ds_get_audit_name();
  262. extern DS_EXPORT_SYMBOL char *ds_get_logfile_name(int config_type);
  263. extern DS_EXPORT_SYMBOL int ds_bring_down_server();
  264. extern DS_EXPORT_SYMBOL void ds_print_server_status(int isrunning);
  265. extern DS_EXPORT_SYMBOL int ds_get_file_size(char *fileName);
  266. extern DS_EXPORT_SYMBOL void ds_display_tail(char *fileName, int timeOut,
  267. int startSeek, char *doneMsg, char *lastLine);
  268. extern DS_EXPORT_SYMBOL char **ds_get_ldif_files();
  269. extern DS_EXPORT_SYMBOL int ds_ldif2db_preserve(char *file);
  270. extern DS_EXPORT_SYMBOL int ds_ldif2db(char *file);
  271. extern DS_EXPORT_SYMBOL int ds_ldif2db_backend_subtree(char *file, char *backend, char *subtree);
  272. extern DS_EXPORT_SYMBOL int ds_db2ldif(char *file);
  273. extern DS_EXPORT_SYMBOL int ds_vlvindex(char **backendList, char **attrList);
  274. extern DS_EXPORT_SYMBOL int ds_addindex(char **attrList, char *backendName);
  275. extern DS_EXPORT_SYMBOL int ds_db2ldif_subtree(char *file, char *subtree);
  276. extern DS_EXPORT_SYMBOL char **ds_get_bak_dirs();
  277. extern DS_EXPORT_SYMBOL int ds_db2bak(char *file);
  278. extern DS_EXPORT_SYMBOL int ds_bak2db(char *file);
  279. extern DS_EXPORT_SYMBOL int ds_get_monitor(int frontend, char *port);
  280. extern DS_EXPORT_SYMBOL int ds_get_bemonitor(char *bemdn, char *port);
  281. extern DS_EXPORT_SYMBOL int ds_client_access(char *port, char *dn);
  282. extern DS_EXPORT_SYMBOL char **ds_get_config(int type);
  283. extern DS_EXPORT_SYMBOL char *ds_get_config_dir();
  284. extern DS_EXPORT_SYMBOL void ds_set_config_dir(char *config_dir);
  285. extern DS_EXPORT_SYMBOL char *ds_get_run_dir();
  286. extern DS_EXPORT_SYMBOL void ds_set_run_dir(char *run_dir);
  287. extern DS_EXPORT_SYMBOL char *ds_get_pwenc(char *passwd_hash, char *password);
  288. extern DS_EXPORT_SYMBOL int ds_check_config(int type);
  289. extern DS_EXPORT_SYMBOL int ds_check_pw(char *pwhash, char *pwclear);
  290. extern DS_EXPORT_SYMBOL int ds_set_config(char *change_file_name);
  291. extern DS_EXPORT_SYMBOL char **ds_get_conf_from_file(FILE *conf);
  292. extern DS_EXPORT_SYMBOL void ds_display_config(char **ds_config);
  293. extern DS_EXPORT_SYMBOL char *ds_get_var_name(int varnum);
  294. extern DS_EXPORT_SYMBOL int ds_showparam(char **ds_config, int varname, int phase,
  295. int occurance, char *dispname, int size, int maxlength, unsigned flags,
  296. char *url);
  297. extern DS_EXPORT_SYMBOL void ds_show_pwmaxage(char *value);
  298. extern DS_EXPORT_SYMBOL void ds_show_pwhash(char *value);
  299. extern DS_EXPORT_SYMBOL char *ds_get_value(char **ds_config, char *parm, int phase, int occurance);
  300. extern DS_EXPORT_SYMBOL void ds_apply_cfg_changes(int param_list[], int changed);
  301. extern DS_EXPORT_SYMBOL int ds_commit_cfg_changes();
  302. extern DS_EXPORT_SYMBOL int ds_config_updated();
  303. extern DS_EXPORT_SYMBOL void ds_display_header(char *font_size, char *header);
  304. extern DS_EXPORT_SYMBOL void ds_display_message(char *font_size, char *header);
  305. extern DS_EXPORT_SYMBOL void ds_print_file_form(char *action, char *fileptr, char *full_fileptr);
  306. extern DS_EXPORT_SYMBOL char *ds_get_file_meaning(char *file);
  307. extern DS_EXPORT_SYMBOL void ds_print_file_name(char *fileptr);
  308. extern DS_EXPORT_SYMBOL int ds_file_exists(char *filename);
  309. extern DS_EXPORT_SYMBOL int ds_cp_file(char *sfile, char *dfile, int mode);
  310. extern DS_EXPORT_SYMBOL time_t ds_get_mtime(char *filename);
  311. extern DS_EXPORT_SYMBOL char *ds_get_config_value( int option );
  312. extern DS_EXPORT_SYMBOL char **ds_get_file_list( char *dir );
  313. extern DS_EXPORT_SYMBOL char *ds_get_tmp_dir();
  314. extern DS_EXPORT_SYMBOL void ds_unixtodospath(char *szText);
  315. extern DS_EXPORT_SYMBOL void ds_timetofname(char *szText);
  316. extern DS_EXPORT_SYMBOL void ds_dostounixpath(char *szText);
  317. extern DS_EXPORT_SYMBOL int ds_saferename(char *szSrc, char *szTarget);
  318. extern DS_EXPORT_SYMBOL char *get_specific_help_button(char *help_link,
  319. char *dispname, char *helpinfo);
  320. /* Change the DN to a canonical format (in place); return DN. */
  321. extern DS_EXPORT_SYMBOL char* dn_normalize (char* DN);
  322. /* Change the DN to a canonical format (in place) and convert to v3; return DN. */
  323. extern DS_EXPORT_SYMBOL char* dn_normalize_convert (char* DN);
  324. /* if dn contains an unescaped quote return true */
  325. extern DS_EXPORT_SYMBOL int ds_dn_uses_LDAPv2_quoting(const char *dn);
  326. /* Return a copy of the DN, but with optional whitespace inserted. */
  327. extern DS_EXPORT_SYMBOL char* ds_dn_expand (char* DN);
  328. /* Return the value if it can be stored 'as is' in a config file.
  329. If it requires enquoting, allocate and return its enquoted form.
  330. The caller should free() the returned pointer iff it's != value.
  331. On Windows, we don't want to double up on "\" characters in filespecs,
  332. so we need to pass in the value type */
  333. extern DS_EXPORT_SYMBOL char* ds_enquote_config_value (int paramnum, char* value);
  334. /*
  335. * Bring up a javascript alert.
  336. */
  337. extern DS_EXPORT_SYMBOL void ds_alert_user(char *header, char *message);
  338. /* Construct and return the DN that corresponds to the give DNS name.
  339. The caller should free() the returned pointer. */
  340. extern DS_EXPORT_SYMBOL char* ds_DNS_to_DN (char* DNS);
  341. /* Construct and return the DN of the LDAP server's own entry.
  342. The caller must NOT free() the returned pointer. */
  343. extern DS_EXPORT_SYMBOL char* ds_get_config_DN (char** ds_config);
  344. /* Encode characters, as described in RFC 1738 section 2.2,
  345. if they're 'unsafe' (as defined in RFC 1738), or '?' or
  346. <special> (as defined in RFC 1779).
  347. The caller should free() the returned pointer. */
  348. extern DS_EXPORT_SYMBOL char* ds_URL_encode (const char*);
  349. /* Decode characters, as described in RFC 1738 section 2.2.
  350. The caller should free() the returned pointer. */
  351. extern DS_EXPORT_SYMBOL char* ds_URL_decode (const char*);
  352. /* Encode all characters, even if 'safe' */
  353. extern DS_EXPORT_SYMBOL char* ds_encode_all (const char*);
  354. /* Change the effective UID and GID of this process to
  355. those associated with the given localuser (if any). */
  356. extern DS_EXPORT_SYMBOL char* ds_become_localuser_name (char* localuser);
  357. /* Change the effective UID and GID of this process to
  358. those associated with ds_config's localuser (if any). */
  359. extern DS_EXPORT_SYMBOL char* ds_become_localuser (char** ds_config);
  360. /* Change the effective UID and GID of this process back to
  361. what they were before calling ds_become_localuser(). */
  362. extern DS_EXPORT_SYMBOL char* ds_become_original();
  363. extern DS_EXPORT_SYMBOL char* ds_makeshort(char *filepath);
  364. extern DS_EXPORT_SYMBOL int ds_search_file(char *filename, char *searchstring);
  365. /* Begin parsing a POST in a CGI context */
  366. extern DS_EXPORT_SYMBOL int ds_post_begin(FILE *input);
  367. /* Begin parsing a GET in a CGI context */
  368. extern DS_EXPORT_SYMBOL void ds_get_begin(char *query_string);
  369. /* Display an error to the user and exit from a CGI */
  370. extern DS_EXPORT_SYMBOL void ds_report_error(int type, char *errmsg, char *details);
  371. /* Display a warning to the user */
  372. extern DS_EXPORT_SYMBOL void ds_report_warning(int type, char *errmsg, char *details);
  373. /* These functions are used by the program to alter the output behaviour
  374. if not executing in a CGI context */
  375. extern DS_EXPORT_SYMBOL int ds_get_formatted_output(void);
  376. extern DS_EXPORT_SYMBOL void ds_set_formatted_output(int val);
  377. /* return the value of a CGI variable */
  378. extern DS_EXPORT_SYMBOL char *ds_a_get_cgi_var(char *varname, char *elem_id, char *bongmsg);
  379. /* return a multi-valued CGI variable */
  380. extern DS_EXPORT_SYMBOL char **ds_a_get_cgi_multiple(char *varname, char *elem_id, char *bongmsg);
  381. /* open an html file */
  382. extern DS_EXPORT_SYMBOL FILE *ds_open_html_file(char *filename);
  383. /* show a message to be parsed by the non-HTML front end */
  384. extern DS_EXPORT_SYMBOL void ds_show_message(const char *message);
  385. /* show a key/value pair to be parsed by the non-HTML front end */
  386. extern DS_EXPORT_SYMBOL void ds_show_key_value(char *key, char *value);
  387. extern DS_EXPORT_SYMBOL void ds_submit(char *helptarget) ;
  388. extern DS_EXPORT_SYMBOL char *ds_get_helpbutton(char *topic);
  389. extern DS_EXPORT_SYMBOL void alter_startup_line(char *startup_line);
  390. extern DS_EXPORT_SYMBOL int ds_dir_exists(char *fn);
  391. extern DS_EXPORT_SYMBOL int ds_mkdir(char *dir, int mode);
  392. extern DS_EXPORT_SYMBOL char *ds_mkdir_p(char *dir, int mode);
  393. extern DS_EXPORT_SYMBOL char *ds_salted_sha1_pw_enc (char* pwd);
  394. extern DS_EXPORT_SYMBOL char * ds_escape_for_shell( char *s );
  395. extern DS_EXPORT_SYMBOL char **ds_string_to_vec(char *s);
  396. extern DS_EXPORT_SYMBOL char *ds_system_errmsg(void);
  397. extern DS_EXPORT_SYMBOL int ds_exec_and_report(char *cmd);
  398. /* remove a directory hierarchy - if the error function is given, it will be called upon
  399. error (e.g. directory not readable, cannot remove file, etc.) - if the callback function
  400. returns 0, this means to abort the removal, otherwise, continue
  401. */
  402. extern DS_EXPORT_SYMBOL int ds_rm_rf(const char *dir, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg);
  403. /*
  404. remove a registry key and report an error message if unsuccessful
  405. */
  406. extern DS_EXPORT_SYMBOL int ds_remove_reg_key(void *base, const char *format, ...);
  407. #ifdef __cplusplus
  408. }
  409. #endif /* __cplusplus */
  410. #endif /* __dsalib_h */