/* Unix SMB/CIFS implementation. tdb based replacement for gettext Copyright (C) Andrew Tridgell 2001 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 2 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "includes.h" #include "system/time.h" static TDB_CONTEXT *tdb; /* the currently selected language */ static char *current_lang; /* load a msg file into the tdb */ static BOOL load_msg(const char *msg_file) { char **lines; int num_lines, i; char *msgid, *msgstr; TDB_DATA key, data; lines = file_lines_load(msg_file, &num_lines); if (!lines) { return False; } if (tdb_lockall(tdb) != 0) return False; /* wipe the db */ tdb_traverse(tdb, tdb_traverse_delete_fn, NULL); msgid = NULL; for (i=0;i