summaryrefslogtreecommitdiff
path: root/wsutil/unicode-utils.h
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-06-30 17:16:29 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-06-30 17:16:29 +0000
commit83f9ecf96fdfac34b5c19c12f4bee9b04c12420c (patch)
tree90375f8b4b84d99576ef5374cdb7e7d596d92329 /wsutil/unicode-utils.h
parent6d4f9c1edab6390b383858efc26c692f1f2ddb1f (diff)
downloadwireshark-83f9ecf96fdfac34b5c19c12f4bee9b04c12420c.tar.gz
Move privileges.c and unicode-utils.c from epan to wsutil (so things like
capinfos and dumpcap don't need to depend on libwireshark nor directly pull in those modules). Because capinfos and editcap were only being linked with privileges.c if we had plugins, this allows those programs to be linked when someone is compiling --without-plugins. svn path=/trunk/; revision=25640
Diffstat (limited to 'wsutil/unicode-utils.h')
-rw-r--r--wsutil/unicode-utils.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/wsutil/unicode-utils.h b/wsutil/unicode-utils.h
new file mode 100644
index 0000000000..2a08be71af
--- /dev/null
+++ b/wsutil/unicode-utils.h
@@ -0,0 +1,54 @@
+/* unicode-utils.h
+ * Unicode utility definitions
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 2006 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __UNICODEUTIL_H__
+#define __UNICODEUTIL_H__
+
+#ifdef _WIN32
+
+/**
+ * @file Unicode convenience routines.
+ */
+
+/** Given a UTF-8 string, convert it to UTF-16. This is meant to be used
+ * to convert between GTK+ 2.x (UTF-8) to Windows (UTF-16).
+ *
+ * @param utf8str The string to convert. May be NULL.
+ * @return The string converted to UTF-16. If utf8str is NULL, returns
+ * NULL. The return value should NOT be freed by the caller.
+ */
+wchar_t * utf_8to16(const char *utf8str);
+
+/** Given a UTF-16 string, convert it to UTF-8. This is meant to be used
+ * to convert between GTK+ 2.x (UTF-8) to Windows (UTF-16).
+ *
+ * @param utf16str The string to convert. May be NULL.
+ * @return The string converted to UTF-8. If utf16str is NULL, returns
+ * NULL. The return value should NOT be freed by the caller.
+ */
+gchar * utf_16to8(const wchar_t *utf16str);
+
+#endif /* _WIN32 */
+
+#endif /* __UNICODEUTIL_H__ */