summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/misc/coding/coding.h
Unidiff
Diffstat (limited to 'gammu/emb/common/misc/coding/coding.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/misc/coding/coding.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/gammu/emb/common/misc/coding/coding.h b/gammu/emb/common/misc/coding/coding.h
index d0c334d..4cf0038 100644
--- a/gammu/emb/common/misc/coding/coding.h
+++ b/gammu/emb/common/misc/coding/coding.h
@@ -2,8 +2,12 @@
2 2
3#ifndef __coding_h 3#ifndef __coding_h
4#define __coding_h 4#define __coding_h
5 5
6#if defined(_MSC_VER) && defined(__cplusplus)
7 extern "C" {
8#endif
9
6#include <stdlib.h> 10#include <stdlib.h>
7 11
8#include "../misc.h" 12#include "../misc.h"
9 13
@@ -12,9 +16,9 @@ typedef int wint_t;
12#endif 16#endif
13 17
14/* ---------------------------- Unicode ------------------------------------ */ 18/* ---------------------------- Unicode ------------------------------------ */
15 bool mywstrncasecmp (unsigned const char *a, unsigned const char *b, int num); 19 bool mywstrncasecmp (unsigned const char *a, unsigned const char *b, int num);
16 unsigned char *mystrstr (unsigned const char *haystack, unsigned const char *needle); 20 unsigned char *mywstrstr (unsigned const char *haystack, unsigned const char *needle);
17 bool mywstrncmp (unsigned const char *a, unsigned const char *b, int num); 21 bool mywstrncmp (unsigned const char *a, unsigned const char *b, int num);
18 bool myiswspace (unsigned const char *src); 22 bool myiswspace (unsigned const char *src);
19 int mytowlower (wchar_t c); 23 int mytowlower (wchar_t c);
20 24
@@ -34,8 +38,11 @@ void ReadUnicodeFile (unsigned char *Dest, unsigned char *Source);
34 38
35 void DecodeUnicodeSpecialNOKIAChars(unsigned char *dest, const unsigned char *src, int len); 39 void DecodeUnicodeSpecialNOKIAChars(unsigned char *dest, const unsigned char *src, int len);
36 void EncodeUnicodeSpecialNOKIAChars(unsigned char *dest, const unsigned char *src, int len); 40 void EncodeUnicodeSpecialNOKIAChars(unsigned char *dest, const unsigned char *src, int len);
37 41
42 char *EncodeUnicodeSpecialChars(unsigned char *buffer);
43 char *DecodeUnicodeSpecialChars(unsigned char *buffer);
44
38/* ------------------------------- BCD ------------------------------------- */ 45/* ------------------------------- BCD ------------------------------------- */
39 unsigned char EncodeWithBCDAlphabet (int value); 46 unsigned char EncodeWithBCDAlphabet (int value);
40 int DecodeWithBCDAlphabet (unsigned char value); 47 int DecodeWithBCDAlphabet (unsigned char value);
41 48
@@ -85,17 +92,17 @@ int GSM_UnpackEightBitsToSeven (int offset, int in_length, int out_length,
85typedef enum { 92typedef enum {
86 /** 93 /**
87 * Unknown number type 94 * Unknown number type
88 */ 95 */
89 NUMBER_UNKNOWN = 0x81, 96 NUMBER_UNKNOWN_NUMBERING_PLAN_ISDN = 0x81,
90 /** 97 /**
91 * International number (full number with code of country) 98 * International number (full number with code of country)
92 */ 99 */
93 NUMBER_INTERNATIONAL= 0x91, 100 NUMBER_INTERNATIONAL_NUMBERING_PLAN_ISDN= 0x91,
94 /** 101 /**
95 * Alphanumeric number (with chars too) 102 * Alphanumeric number (with chars too)
96 */ 103 */
97 NUMBER_ALPHANUMERIC= 0xD0 104 NUMBER_ALPHANUMERIC_NUMBERING_PLAN_UNKNOWN= 0xD0
98 105
99 /* specification give also other values */ 106 /* specification give also other values */
100} GSM_NumberType; 107} GSM_NumberType;
101 108
@@ -121,11 +128,19 @@ int ClearBit (unsigned char *Buffer, int BitNum);
121/* ---------------------------- Other -------------------------------------- */ 128/* ---------------------------- Other -------------------------------------- */
122 129
123 void StringToDouble(char *text, double *d); 130 void StringToDouble(char *text, double *d);
124 131
125bool mystrncasecmp (unsigned const char *a, unsigned const char *b, int num); 132 bool mystrncasecmp (unsigned const char *a, unsigned const char *b, int num);
133 char *mystrcasestr (unsigned const char *a, unsigned const char *b);
126 134
127void MyGetLine(unsigned char *Buffer, int *Pos, unsigned char *OutBuffer, int MaxLen); 135 void MyGetLine (unsigned char *Buffer, int *Pos, unsigned char *OutBuffer, int MaxLen);
136
137char *EncodeSpecialChars(unsigned char *buffer);
138char *DecodeSpecialChars(unsigned char *buffer);
139
140#if defined(_MSC_VER) && defined(__cplusplus)
141 }
142#endif
128 143
129#endif 144#endif
130 145
131/* How should editor hadle tabs in this file? Add editor commands here. 146/* How should editor hadle tabs in this file? Add editor commands here.