]> arthur.barton.de Git - netatalk.git/blobdiff - bin/uniconv/uniconv.c
Whitespace and exclamation mark fixes
[netatalk.git] / bin / uniconv / uniconv.c
index e6d1daeb4d5fa470bb677687d3fcfc2ec7ad726d..b9a2fc45c87b56e4fdccd2954cd34d32d36ed626 100644 (file)
 #include <sys/param.h>
 #include <pwd.h>
 #include <dirent.h>
+#include <arpa/inet.h>
+
 #include <atalk/afp.h>
 #include <atalk/unicode.h>
 #include <atalk/util.h>
 #include <atalk/logger.h>
+#include <atalk/compat.h>
 
 #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");
 
 }