summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/misc/coding/coding.h
Side-by-side diff
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 @@
#ifndef __coding_h
#define __coding_h
+#if defined(_MSC_VER) && defined(__cplusplus)
+ extern "C" {
+#endif
+
#include <stdlib.h>
#include "../misc.h"
@@ -12,9 +16,9 @@ typedef int wint_t;
#endif
/* ---------------------------- Unicode ------------------------------------ */
bool mywstrncasecmp (unsigned const char *a, unsigned const char *b, int num);
-unsigned char *mystrstr (unsigned const char *haystack, unsigned const char *needle);
+unsigned char *mywstrstr (unsigned const char *haystack, unsigned const char *needle);
bool mywstrncmp (unsigned const char *a, unsigned const char *b, int num);
bool myiswspace (unsigned const char *src);
int mytowlower (wchar_t c);
@@ -34,8 +38,11 @@ void ReadUnicodeFile (unsigned char *Dest, unsigned char *Source);
void DecodeUnicodeSpecialNOKIAChars (unsigned char *dest, const unsigned char *src, int len);
void EncodeUnicodeSpecialNOKIAChars (unsigned char *dest, const unsigned char *src, int len);
+char *EncodeUnicodeSpecialChars (unsigned char *buffer);
+char *DecodeUnicodeSpecialChars (unsigned char *buffer);
+
/* ------------------------------- BCD ------------------------------------- */
unsigned char EncodeWithBCDAlphabet (int value);
int DecodeWithBCDAlphabet (unsigned char value);
@@ -85,17 +92,17 @@ int GSM_UnpackEightBitsToSeven (int offset, int in_length, int out_length,
typedef enum {
/**
* Unknown number type
*/
- NUMBER_UNKNOWN = 0x81,
+ NUMBER_UNKNOWN_NUMBERING_PLAN_ISDN = 0x81,
/**
* International number (full number with code of country)
*/
- NUMBER_INTERNATIONAL = 0x91,
+ NUMBER_INTERNATIONAL_NUMBERING_PLAN_ISDN = 0x91,
/**
* Alphanumeric number (with chars too)
*/
- NUMBER_ALPHANUMERIC = 0xD0
+ NUMBER_ALPHANUMERIC_NUMBERING_PLAN_UNKNOWN = 0xD0
/* specification give also other values */
} GSM_NumberType;
@@ -121,11 +128,19 @@ int ClearBit (unsigned char *Buffer, int BitNum);
/* ---------------------------- Other -------------------------------------- */
void StringToDouble (char *text, double *d);
-bool mystrncasecmp (unsigned const char *a, unsigned const char *b, int num);
+bool mystrncasecmp (unsigned const char *a, unsigned const char *b, int num);
+char *mystrcasestr (unsigned const char *a, unsigned const char *b);
-void MyGetLine(unsigned char *Buffer, int *Pos, unsigned char *OutBuffer, int MaxLen);
+void MyGetLine (unsigned char *Buffer, int *Pos, unsigned char *OutBuffer, int MaxLen);
+
+char *EncodeSpecialChars(unsigned char *buffer);
+char *DecodeSpecialChars(unsigned char *buffer);
+
+#if defined(_MSC_VER) && defined(__cplusplus)
+ }
+#endif
#endif
/* How should editor hadle tabs in this file? Add editor commands here.