annotate src/internal.h @ 8995:9caf796e74aa

[gaim-migrate @ 9770] "Luke, if you get a chance, could you commit this? It should improve the HTML escaping situation between Gaim and other AIM and ICQ clients. I haven't actually applied it locally or tested it, but it looks ok to me. I would do it myself, but there are other changes in my oscar.c that aren't ready to commit, and I want to go to sleep so I can wake up tomorrow... I'll probably be out of town climbing until Sunday night... "--Mark Doliner "Below is an email I nearly sent you, before deciding to test & document the failure cases I knew of. http://www.nosnilmot.com/gaim/oscar-html.txt shows how current CVS behaves sending the string "<foo>" between GaimICQ/GaimAIM/ICQLite/WinAIM in various combinations After that testing I couldn't help trying to fix it :) The attached patch, from my testing, resolves all those marked with "XX" so that what is received matches what the user sent. The code might not be the most efficient and may contain redundant bits but I've had enough of this for now, 2 Windows crashes which caused VMWare to be weird and half break my keyboard and require restarting X. The patch might want a bit more testing, especially with iChat (I'm unable to test with that). Maybe committing it to CVS might get it some more testing though ;-)" --Stu Tomlinson committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 21 May 2004 11:55:08 +0000
parents d72a23b2bfb5
children 5d9c991549cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8790
240c6282f546 [gaim-migrate @ 9552]
Luke Schierer <lschiere@pidgin.im>
parents: 8737
diff changeset
1 /**
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file internal.h Internal definitions and includes
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
3 * @ingroup core
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6371
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6371
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6371
diff changeset
9 * source distribution.
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #ifndef _GAIM_INTERNAL_H_
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 #define _GAIM_INTERNAL_H_
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #ifdef HAVE_CONFIG_H
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
29 # include <config.h>
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 #ifdef ENABLE_NLS
8737
504570a1acd5 [gaim-migrate @ 9492]
Mark Doliner <mark@kingant.net>
parents: 8735
diff changeset
33 # include <locale.h>
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 # include <libintl.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 # define _(x) gettext(x)
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 # ifdef gettext_noop
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 # define N_(String) gettext_noop (String)
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 # else
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 # define N_(String) (String)
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 # endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 #else
8730
8b935eddeb10 [gaim-migrate @ 9485]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
42 # include <locale.h>
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 # define N_(String) (String)
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 # define _(x) (x)
5976
7cce6643c51e [gaim-migrate @ 6423]
Mark Doliner <mark@kingant.net>
parents: 5912
diff changeset
45 # define ngettext(Singular, Plural, Number) ((Number == 1) ? (Singular) : (Plural))
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 #endif
5976
7cce6643c51e [gaim-migrate @ 6423]
Mark Doliner <mark@kingant.net>
parents: 5912
diff changeset
47 /*
8793
d72a23b2bfb5 [gaim-migrate @ 9555]
Mark Doliner <mark@kingant.net>
parents: 8790
diff changeset
48 * The Singular/Plural/Number ngettext definition above was taken
d72a23b2bfb5 [gaim-migrate @ 9555]
Mark Doliner <mark@kingant.net>
parents: 8790
diff changeset
49 * from an email to the texinfo mailing list by Manuel Guerrero.
d72a23b2bfb5 [gaim-migrate @ 9555]
Mark Doliner <mark@kingant.net>
parents: 8790
diff changeset
50 * Thank you Manuel, and thank you Alex's good friend Google.
5976
7cce6643c51e [gaim-migrate @ 6423]
Mark Doliner <mark@kingant.net>
parents: 5912
diff changeset
51 */
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 #ifdef HAVE_ENDIAN_H
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 # include <endian.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 #define MSG_LEN 2048
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 /* The above should normally be the same as BUF_LEN,
8735
92cbf9713795 [gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents: 8730
diff changeset
59 * but just so we're explicitly asking for the max message
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 * length. */
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 #define BUF_LEN MSG_LEN
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 #define BUF_LONG BUF_LEN * 2
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 #include <sys/stat.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 #include <sys/time.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 #include <sys/types.h>
5912
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
67 #ifndef _WIN32
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 #include <sys/wait.h>
5912
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
69 #endif
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 #include <ctype.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 #include <errno.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 #include <fcntl.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 #include <math.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 #include <stdio.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 #include <stdlib.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 #include <string.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 #include <time.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 #ifdef HAVE_ICONV
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 #include <iconv.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 #ifdef HAVE_LANGINFO_CODESET
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 #include <langinfo.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 #ifdef GAIM_PLUGINS
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 # include <gmodule.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 # ifndef _WIN32
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 # include <dlfcn.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 # endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93
5912
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
94 #ifndef _WIN32
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 # include <netinet/in.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 # include <sys/socket.h>
6170
66ab9c9b3524 [gaim-migrate @ 6655]
Luke Schierer <lschiere@pidgin.im>
parents: 5976
diff changeset
97 # include <arpa/inet.h>
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 # include <sys/un.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 # include <sys/utsname.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 # include <netdb.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 # include <signal.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 # include <unistd.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 #ifndef MAXPATHLEN
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 # define MAXPATHLEN 1024
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 #ifndef HOST_NAME_MAX
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 # define HOST_NAME_MAX 255
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 #endif
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 #define PATHSIZE 1024
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 #include <glib.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116
5912
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
117 #ifdef _WIN32
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
118 #include "win32dep.h"
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
119 #endif
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
120
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5872
diff changeset
121
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
122 #define GAIM_WEBSITE "http://gaim.sourceforge.net/"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 #endif /* _GAIM_INTERNAL_H_ */