/*
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 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 .
*/
#include "includes.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 data;
lines = file_lines_load(msg_file, &num_lines,0);
if (!lines) {
return False;
}
if (tdb_lockall(tdb) != 0) {
file_lines_free(lines);
return False;
}
/* wipe the db */
tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
msgid = NULL;
for (i=0;i