summaryrefslogtreecommitdiff
path: root/source3/include/smb.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-04 07:15:53 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-04 07:15:53 +0000
commit87fbb7092b8f8b2f0db0f361c3d625e19de57cd9 (patch)
tree3c302f710cbaa03e3c0d46549e8982771b12b8a5 /source3/include/smb.h
parent9e9e73303ec10a64bd744b9b33f4e6cd7d394f03 (diff)
downloadsamba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.tar.gz
samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.tar.bz2
samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.zip
The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
Diffstat (limited to 'source3/include/smb.h')
-rw-r--r--source3/include/smb.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 1cceb88983..091ed2ac66 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -53,11 +53,10 @@ typedef int BOOL;
/* string manipulation flags - see clistr.c and srvstr.c */
#define STR_TERMINATE 1
-#define STR_CONVERT 2
-#define STR_UPPER 4
-#define STR_ASCII 8
-#define STR_UNICODE 16
-#define STR_NOALIGN 32
+#define STR_UPPER 2
+#define STR_ASCII 4
+#define STR_UNICODE 8
+#define STR_NOALIGN 16
/* how long to wait for secondary SMB packets (milli-seconds) */
#define SMB_SECONDARY_WAIT (60*1000)
@@ -289,6 +288,16 @@ typedef uint16 smb_ucs2_t;
typedef smb_ucs2_t wpstring[PSTRING_LEN];
typedef smb_ucs2_t wfstring[FSTRING_LEN];
+
+#ifdef WORDS_BIGENDIAN
+#define UCS2_SHIFT 8
+#else
+#define UCS2_SHIFT 0
+#endif
+
+/* turn a 7 bit character into a ucs2 character */
+#define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
+
/* pipe string names */
#define PIPE_LANMAN "\\PIPE\\LANMAN"
#define PIPE_SRVSVC "\\PIPE\\srvsvc"
@@ -790,7 +799,6 @@ struct bitmap {
#define FLAG_GLOBAL 0x08 /* local options that should be globally settable in SWAT */
#define FLAG_DEPRECATED 0x10 /* options that should no longer be used */
#define FLAG_HIDE 0x20 /* options that should be hidden in SWAT */
-#define FLAG_DOS_STRING 0x40 /* convert from UNIX to DOS codepage when reading this string. */
#ifndef LOCKING_VERSION
#define LOCKING_VERSION 4
@@ -1676,4 +1684,18 @@ typedef struct {
TALLOC_CTX *mem_ctx;
} CLI_POLICY_HND;
+
+/* generic iconv conversion structure */
+typedef struct {
+ size_t (*direct)(char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft);
+ size_t (*pull)(char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft);
+ size_t (*push)(char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft);
+#ifdef HAVE_NATIVE_ICONV
+ iconv_t cd;
+#endif
+} *smb_iconv_t;
+
#endif /* _SMB_H */