*/
#include "includes.h"
+#include "system/filesys.h"
+#include "popt_common.h"
#undef realloc
static int
static int
-process_fd (iconv_t cd, int fd, FILE *output)
+process_fd (smb_iconv_t cd, int fd, FILE *output)
{
/* we have a problem with reading from a descriptor since we must not
provide the iconv() function an incomplete character or shift
int main(int argc, char *argv[])
{
const char *file = NULL;
- char *from = "";
- char *to = "";
+ const char *from = "";
+ const char *to = "";
char *output = NULL;
const char *preload_modules[] = {NULL, NULL};
FILE *out = stdout;
/* the following functions are part of the Samba debugging
facilities. See lib/debug.c */
- setup_logging("smbiconv", True);
+ setup_logging("smbiconv", DEBUG_STDOUT);
if (preload_modules[0]) smb_load_modules(preload_modules);
}
cd = smb_iconv_open(to, from);
- if((int)cd == -1) {
+ if (cd == (smb_iconv_t)-1) {
DEBUG(0,("unable to find from or to encoding, exiting...\n"));
+ if (out != stdout) fclose(out);
return 1;
}