Whamcloud - gitweb
libext2fs: move struct ext2fs_nls_table to the private ext2fsP.h header
authorTheodore Ts'o <tytso@mit.edu>
Fri, 3 May 2019 20:42:36 +0000 (16:42 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 3 May 2019 20:43:05 +0000 (16:43 -0400)
Callers of libext2fs don't need to use this structure, and this gives
us the ability to change it later on without worrying about
changing public ABI's.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/dirhash.c
lib/ext2fs/ext2fs.h
lib/ext2fs/ext2fsP.h
lib/ext2fs/nls_utf8.c

index 6f5cdc4..d560e20 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "ext2_fs.h"
 #include "ext2fs.h"
+#include "ext2fsP.h"
 
 /*
  * Keyed 32-bit hash function using TEA in a Davis-Meyer function
@@ -282,8 +283,9 @@ errcode_t ext2fs_dirhash2(int version, const char *name, int len,
        if (len && charset && (hash_flags & EXT4_CASEFOLD_FL)) {
                char buff[PATH_MAX];
 
-               dlen = charset->ops->casefold(charset, name, len, buff,
-                                                     sizeof(buff));
+               dlen = charset->ops->casefold(charset,
+                             (const unsigned char *) name, len,
+                             (unsigned char *) buff, sizeof(buff));
                if (dlen < 0) {
                        if (dlen == -EINVAL)
                                goto opaque_seq;
index c3be2c5..7d7c346 100644 (file)
@@ -178,20 +178,6 @@ typedef struct ext2_file *ext2_file_t;
 #define EXT2_SEEK_END  2
 
 /*
- * NLS defintions
- */
-struct ext2fs_nls_table {
-       int version;
-       const struct ext2fs_nls_ops *ops;
-};
-
-struct ext2fs_nls_ops {
-       int (*casefold)(const struct ext2fs_nls_table *charset,
-                       const unsigned char *str, size_t len,
-                       unsigned char *dest, size_t dlen);
-};
-
-/*
  * Flags for the ext2_filsys structure and for ext2fs_open()
  */
 #define EXT2_FLAG_RW                   0x01
index fd5b4b1..ad8b7d5 100644 (file)
@@ -92,6 +92,20 @@ struct ext2_inode_cache_ent {
        struct ext2_inode       *inode;
 };
 
+/*
+ * NLS defintions
+ */
+struct ext2fs_nls_table {
+       int version;
+       const struct ext2fs_nls_ops *ops;
+};
+
+struct ext2fs_nls_ops {
+       int (*casefold)(const struct ext2fs_nls_table *charset,
+                       const unsigned char *str, size_t len,
+                       unsigned char *dest, size_t dlen);
+};
+
 /* Function prototypes */
 
 extern int ext2fs_process_dir_block(ext2_filsys        fs,
index 9cb6a78..4214809 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "ext2_fs.h"
 #include "ext2fs.h"
+#include "ext2fsP.h"
 
 /* Encoding a unicode version number as a single unsigned int. */
 #define UNICODE_MAJ_SHIFT              (16)