summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/conv.h
blob: 80d44f888debb1e39423db9df37b3b014703f302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
Plugin of Miranda IM for communicating with users of the AIM protocol.
Copyright (c) 2008-2009 Boris Krasnovskiy
Copyright (C) 2005-2006 Aaron Myles Landwehr

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, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONV_H
#define CONV_H

char* process_status_msg (const char *src, const char* sn);
void  html_decode(char* str);
char* html_encode(const char *src);
char* html_to_bbcodes(char *src);
char* bbcodes_to_html(const char *src);
void strip_tag(char* begin, char* end);
char* strip_tag_within(char* begin, char* end);
char* rtf_to_html(HWND hwndDlg,int DlgItem);
void wcs_htons(wchar_t * ch);
char* bytes_to_string(char* bytes, int num_bytes);
void string_to_bytes(char* string, char* bytes);
bool is_utf(const char* msg);
char* get_fname(char* path);
wchar_t* get_dir(wchar_t* path);

struct aimString
{
	union
	{
		char* szString;
		wchar_t* wszString;
	};
	size_t size;
	bool unicode;

	aimString(char* str);
	~aimString() { mir_free(szString); }

	bool isUnicode(void) { return unicode; }
	unsigned short getSize(void) { return (unsigned short)size; }
	unsigned short getTermSize(void) { return (unsigned short)(size + (unicode ? sizeof(wchar_t) : sizeof(char))); }
	char* getBuf(void) { return szString; }  
};

#endif