comparison mcabber/mcabber/utils.h @ 1668:41c26b7d2890

Install mcabber headers * Change mcabber headers naming scheme * Move 'src/' -> 'mcabber/' * Add missing include <mcabber/config.h>'s * Create and install clean config.h version in 'include/' * Move "dirty" config.h version to 'mcabber/' * Add $(top_srcdir) to compiler include path * Update modules HOWTO
author Myhailo Danylenko <isbear@ukrpost.net>
date Mon, 18 Jan 2010 15:36:19 +0200
parents mcabber/src/utils.h@f9bf561e54d0
children f02e7076ccec
comparison
equal deleted inserted replaced
1667:8af0e0ad20ad 1668:41c26b7d2890
1 #ifndef __MCABBER_UTILS_H__
2 #define __MCABBER_UTILS_H__ 1
3
4 #include <mcabber/config.h>
5
6 extern const char *LocaleCharSet;
7
8 #define to_utf8(s) ((s) ? g_locale_to_utf8((s), -1, NULL,NULL,NULL) : NULL)
9 #define from_utf8(s) ((s) ? g_convert_with_fallback((s), -1, LocaleCharSet, \
10 "UTF-8", NULL,NULL,NULL,NULL) : NULL)
11
12 #define JID_RESOURCE_SEPARATOR '/'
13 #define JID_RESOURCE_SEPARATORSTR "/"
14 #define JID_DOMAIN_SEPARATOR '@'
15 #define JID_DOMAIN_SEPARATORSTR "@"
16
17 char *jidtodisp(const char *fjid);
18 char *jid_get_username(const char *fjid);
19 char *compose_jid(const char *username, const char *servername,
20 const char *resource);
21 gboolean jid_equal(const char *jid1, const char *jid2);
22
23 void fingerprint_to_hex(const unsigned char *fpr, char hex[49]);
24 gboolean hex_to_fingerprint(const char * hex, char fpr[16]);
25
26 void ut_InitDebug(int level, const char *file);
27 void ut_WriteLog(unsigned int flag, const char *data);
28
29 char *expand_filename(const char *fname);
30
31 int checkset_perm(const char *name, unsigned int setmode);
32
33 const char *ut_get_tmpdir(void);
34
35 int to_iso8601(char *dststr, time_t timestamp);
36 time_t from_iso8601(const char *timestamp, int utc);
37
38 int check_jid_syntax(const char *fjid);
39
40 void mc_strtolower(char *str);
41
42 void strip_arg_special_chars(char *s);
43 char **split_arg(const char *arg, unsigned int n, int dontstriplast);
44 void free_arg_lst(char **arglst);
45
46 void replace_nl_with_dots(char *bufstr);
47 char *ut_expand_tabs(const char *text);
48
49 #if !defined (HAVE_STRCASESTR)
50 char *strcasestr(const char *haystack, const char *needle);
51 #endif
52
53 int startswith(const char *str, const char *word, guint ignore_case);
54
55 #endif // __MCABBER_UTILS_H__
56
57 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */