X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Funiconv%2Funiconv.c;h=b9a2fc45c87b56e4fdccd2954cd34d32d36ed626;hb=b1338b390059f9f7019edc1080833f5002e948d8;hp=e6d1daeb4d5fa470bb677687d3fcfc2ec7ad726d;hpb=6145c1c31a1a2494fe6ad7ca65f9c2a63a05b07d;p=netatalk.git diff --git a/bin/uniconv/uniconv.c b/bin/uniconv/uniconv.c index e6d1daeb..b9a2fc45 100644 --- a/bin/uniconv/uniconv.c +++ b/bin/uniconv/uniconv.c @@ -35,10 +35,13 @@ #include #include #include +#include + #include #include #include #include +#include #include "atalk/cnid.h" #ifndef MAXPATHLEN @@ -57,7 +60,7 @@ char* to_charset; static charset_t ch_mac; char* mac_charset; static int usedots = 0; -static u_int16_t conv_flags = 0; +static uint16_t conv_flags = 0; static int dry_run = 0; static int verbose=0; char *cnid_type; @@ -146,7 +149,7 @@ static char *convert_name(char *name, struct stat *st, cnid_t cur_did) size_t outlen = 0; unsigned char *p,*q; int require_conversion = 0; - u_int16_t flags = conv_flags; + uint16_t flags = conv_flags; cnid_t id; p = (unsigned char *)name; @@ -181,8 +184,8 @@ static char *convert_name(char *name, struct stat *st, cnid_t cur_did) outlen = convert_charset(ch_to, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags); if ((size_t)-1 == outlen) { /* it's not UTF8... */ - fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed!!!\n", - from_charset, to_charset, name, ntohl(cur_did)); + fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed!\n", + from_charset, to_charset, name, ntohl(cur_did)); return name; } @@ -386,7 +389,7 @@ static int init(char* path) { DIR* startdir; - if (NULL == (cdb = cnid_open (path, 0, cnid_type, 0, "localhost", "4700")) ) { + if (NULL == (cdb = cnid_open (path, 0, cnid_type, 0, "localhost", "4700", NULL, NULL)) ) { fprintf (stderr, "ERROR: cannot open CNID database in '%s'\n", path); fprintf (stderr, "ERROR: check the logs for reasons, aborting\n"); return -1; @@ -438,11 +441,11 @@ static void help (void) fprintf (stdout, "\t-V\tPrint version and exit\n"); fprintf (stdout, "\t-h\tThis help screen\n\n"); fprintf (stdout, "WARNING:\n"); - fprintf (stdout, " Setting the wrong options might render your data unusable!!!\n"); + fprintf (stdout, " Setting the wrong options might render your data unusable!\n"); fprintf (stdout, " Make sure you know what you are doing. Always backup your data first.\n\n"); fprintf (stdout, " It is *strongly* recommended to do a `dry run' first and to check the\n"); fprintf (stdout, " output for conversion errors.\n"); - fprintf (stdout, " USE AT YOUR OWN RISK!!!\n\n"); + fprintf (stdout, " USE AT YOUR OWN RISK!\n\n"); }