Mercurial > hg
annotate mcabber/src/utils.h @ 1405:e21757606b5b
Update UK help files
author | Myhailo Danylenko <isbear@ukrpost.net> |
---|---|
date | Fri, 11 Jan 2008 12:06:50 +0100 |
parents | 753a348c65c1 |
children | f89844a0448a |
rev | line source |
---|---|
24 | 1 #ifndef __UTILS_H__ |
2 #define __UTILS_H__ 1 | |
3 | |
803
8f8d8f8157a2
Take care of the strcasestr lacking (Cygwin)
Soren Andersen <somian@pobox.com>
parents:
727
diff
changeset
|
4 #include <config.h> |
8f8d8f8157a2
Take care of the strcasestr lacking (Cygwin)
Soren Andersen <somian@pobox.com>
parents:
727
diff
changeset
|
5 |
1390 | 6 extern const char *LocaleCharSet; |
592
67a332121aea
Try UTF8 -> locale conversion with fallback
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
7 |
469
a926523d2392
Use UTF8 to handle resources and room nicknames
Mikael Berthe <mikael@lilotux.net>
parents:
452
diff
changeset
|
8 #define to_utf8(s) ((s) ? g_locale_to_utf8((s), -1, NULL,NULL,NULL) : NULL) |
592
67a332121aea
Try UTF8 -> locale conversion with fallback
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
9 #define from_utf8(s) ((s) ? g_convert_with_fallback((s), -1, LocaleCharSet, \ |
67a332121aea
Try UTF8 -> locale conversion with fallback
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
10 "UTF-8", NULL,NULL,NULL,NULL) : NULL) |
469
a926523d2392
Use UTF8 to handle resources and room nicknames
Mikael Berthe <mikael@lilotux.net>
parents:
452
diff
changeset
|
11 |
977
5b01de4ac5e1
Cosmetic changes
Alexis Hildebrandt <afh [at] 2drop [dot] net>
parents:
952
diff
changeset
|
12 #define JID_RESOURCE_SEPARATOR '/' |
5b01de4ac5e1
Cosmetic changes
Alexis Hildebrandt <afh [at] 2drop [dot] net>
parents:
952
diff
changeset
|
13 #define JID_RESOURCE_SEPARATORSTR "/" |
5b01de4ac5e1
Cosmetic changes
Alexis Hildebrandt <afh [at] 2drop [dot] net>
parents:
952
diff
changeset
|
14 #define JID_DOMAIN_SEPARATOR '@' |
5b01de4ac5e1
Cosmetic changes
Alexis Hildebrandt <afh [at] 2drop [dot] net>
parents:
952
diff
changeset
|
15 #define JID_DOMAIN_SEPARATORSTR "@" |
5b01de4ac5e1
Cosmetic changes
Alexis Hildebrandt <afh [at] 2drop [dot] net>
parents:
952
diff
changeset
|
16 |
952 | 17 void ut_InitDebug(int level, const char *file); |
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
364
diff
changeset
|
18 void ut_WriteLog(unsigned int flag, const char *data); |
24 | 19 |
1167
9726c78a91f3
Allow '~' (HOME directory) in config options
Mikael Berthe <mikael@lilotux.net>
parents:
1106
diff
changeset
|
20 char *expand_filename(const char *fname); |
9726c78a91f3
Allow '~' (HOME directory) in config options
Mikael Berthe <mikael@lilotux.net>
parents:
1106
diff
changeset
|
21 |
362
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
281
diff
changeset
|
22 int checkset_perm(const char *name, unsigned int setmode); |
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
281
diff
changeset
|
23 |
524
05c0e55c4bb1
Pass message body to external command
Mikael Berthe <mikael@lilotux.net>
parents:
469
diff
changeset
|
24 const char *ut_get_tmpdir(void); |
05c0e55c4bb1
Pass message body to external command
Mikael Berthe <mikael@lilotux.net>
parents:
469
diff
changeset
|
25 |
241 | 26 int to_iso8601(char *dststr, time_t timestamp); |
27 time_t from_iso8601(const char *timestamp, int utc); | |
28 | |
419 | 29 inline void safe_usleep(unsigned int usec); /* Only for delays < 1s */ |
30 | |
1292
382ec54b584e
Muc nick coloring functionality
Michal 'vorner' Vaner <vorner@ucw.cz>
parents:
1203
diff
changeset
|
31 int check_jid_syntax(const char *fjid); |
452 | 32 |
1106 | 33 inline void mc_strtolower(char *str); |
452 | 34 |
554
2424bbf0a6db
Some more work on do_room()
Mikael Berthe <mikael@lilotux.net>
parents:
551
diff
changeset
|
35 void strip_arg_special_chars(char *s); |
2424bbf0a6db
Some more work on do_room()
Mikael Berthe <mikael@lilotux.net>
parents:
551
diff
changeset
|
36 char **split_arg(const char *arg, unsigned int n, int dontstriplast); |
551
c71699efa5cc
Add split_arg() / free_arg_lst()
Mikael Berthe <mikael@lilotux.net>
parents:
524
diff
changeset
|
37 void free_arg_lst(char **arglst); |
c71699efa5cc
Add split_arg() / free_arg_lst()
Mikael Berthe <mikael@lilotux.net>
parents:
524
diff
changeset
|
38 |
655
de6837908702
Use "(...)" when cutting a multi-line status message in the log window
Mikael Berthe <mikael@lilotux.net>
parents:
592
diff
changeset
|
39 void replace_nl_with_dots(char *bufstr); |
727
1c3620668857
Expand tabs when reading history files
Mikael Berthe <mikael@lilotux.net>
parents:
655
diff
changeset
|
40 char *ut_expand_tabs(const char *text); |
655
de6837908702
Use "(...)" when cutting a multi-line status message in the log window
Mikael Berthe <mikael@lilotux.net>
parents:
592
diff
changeset
|
41 |
803
8f8d8f8157a2
Take care of the strcasestr lacking (Cygwin)
Soren Andersen <somian@pobox.com>
parents:
727
diff
changeset
|
42 #if !defined (HAVE_STRCASESTR) |
8f8d8f8157a2
Take care of the strcasestr lacking (Cygwin)
Soren Andersen <somian@pobox.com>
parents:
727
diff
changeset
|
43 char *strcasestr(const char *haystack, const char *needle); |
24 | 44 #endif |
576 | 45 |
1203 | 46 int startswith(const char *str, const char *word, guint ignore_case); |
1192 | 47 |
803
8f8d8f8157a2
Take care of the strcasestr lacking (Cygwin)
Soren Andersen <somian@pobox.com>
parents:
727
diff
changeset
|
48 #endif // __UTILS_H__ |
8f8d8f8157a2
Take care of the strcasestr lacking (Cygwin)
Soren Andersen <somian@pobox.com>
parents:
727
diff
changeset
|
49 |
580 | 50 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |