Move SMB-specific attribute function to SMB client library.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 19 Oct 2008 08:45:02 +0000 (10:45 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 19 Oct 2008 08:45:02 +0000 (10:45 +0200)
lib/util/util_str.c
source4/libcli/raw/rawfile.c

index 231f7f2c6f3367a8d8753dbfcaeed90f4b0bba53..6f8a921cd25c55878c4a825e238948f5de0d6cae 100644 (file)
@@ -22,8 +22,9 @@
 */
 
 #include "includes.h"
-#include "libcli/raw/smb.h"
 #include "system/locale.h"
+#undef strncasecmp
+#undef strcasemp
 
 /**
  * @file
@@ -405,51 +406,6 @@ _PUBLIC_ size_t ascii_len_n(const char *src, size_t n)
        return len;
 }
 
-
-/**
- Return a string representing a CIFS attribute for a file.
-**/
-_PUBLIC_ char *attrib_string(TALLOC_CTX *mem_ctx, uint32_t attrib)
-{
-       int i, len;
-       const struct {
-               char c;
-               uint16_t attr;
-       } attr_strs[] = {
-               {'V', FILE_ATTRIBUTE_VOLUME},
-               {'D', FILE_ATTRIBUTE_DIRECTORY},
-               {'A', FILE_ATTRIBUTE_ARCHIVE},
-               {'H', FILE_ATTRIBUTE_HIDDEN},
-               {'S', FILE_ATTRIBUTE_SYSTEM},
-               {'N', FILE_ATTRIBUTE_NORMAL},
-               {'R', FILE_ATTRIBUTE_READONLY},
-               {'d', FILE_ATTRIBUTE_DEVICE},
-               {'t', FILE_ATTRIBUTE_TEMPORARY},
-               {'s', FILE_ATTRIBUTE_SPARSE},
-               {'r', FILE_ATTRIBUTE_REPARSE_POINT},
-               {'c', FILE_ATTRIBUTE_COMPRESSED},
-               {'o', FILE_ATTRIBUTE_OFFLINE},
-               {'n', FILE_ATTRIBUTE_NONINDEXED},
-               {'e', FILE_ATTRIBUTE_ENCRYPTED}
-       };
-       char *ret;
-
-       ret = talloc_array(mem_ctx, char, ARRAY_SIZE(attr_strs)+1);
-       if (!ret) {
-               return NULL;
-       }
-
-       for (len=i=0; i<ARRAY_SIZE(attr_strs); i++) {
-               if (attrib & attr_strs[i].attr) {
-                       ret[len++] = attr_strs[i].c;
-               }
-       }
-
-       ret[len] = 0;
-
-       return ret;
-}
-
 /**
  Set a boolean variable from the text value stored in the passed string.
  Returns true in success, false if the passed string does not correctly 
index d39c61551be7b0b2f4158c04b01160dddb45c242..d174fbfc28d5aff3c3a3a316975d585f9bf0c86d 100644 (file)
        if (!req) return NULL; \
 } while (0)
 
+/**
+ Return a string representing a CIFS attribute for a file.
+**/
+_PUBLIC_ char *attrib_string(TALLOC_CTX *mem_ctx, uint32_t attrib)
+{
+       int i, len;
+       const struct {
+               char c;
+               uint16_t attr;
+       } attr_strs[] = {
+               {'V', FILE_ATTRIBUTE_VOLUME},
+               {'D', FILE_ATTRIBUTE_DIRECTORY},
+               {'A', FILE_ATTRIBUTE_ARCHIVE},
+               {'H', FILE_ATTRIBUTE_HIDDEN},
+               {'S', FILE_ATTRIBUTE_SYSTEM},
+               {'N', FILE_ATTRIBUTE_NORMAL},
+               {'R', FILE_ATTRIBUTE_READONLY},
+               {'d', FILE_ATTRIBUTE_DEVICE},
+               {'t', FILE_ATTRIBUTE_TEMPORARY},
+               {'s', FILE_ATTRIBUTE_SPARSE},
+               {'r', FILE_ATTRIBUTE_REPARSE_POINT},
+               {'c', FILE_ATTRIBUTE_COMPRESSED},
+               {'o', FILE_ATTRIBUTE_OFFLINE},
+               {'n', FILE_ATTRIBUTE_NONINDEXED},
+               {'e', FILE_ATTRIBUTE_ENCRYPTED}
+       };
+       char *ret;
+
+       ret = talloc_array(mem_ctx, char, ARRAY_SIZE(attr_strs)+1);
+       if (!ret) {
+               return NULL;
+       }
+
+       for (len=i=0; i<ARRAY_SIZE(attr_strs); i++) {
+               if (attrib & attr_strs[i].attr) {
+                       ret[len++] = attr_strs[i].c;
+               }
+       }
+
+       ret[len] = 0;
+
+       return ret;
+}
+
 /****************************************************************************
  Rename a file - async interface
 ****************************************************************************/