Change license to APLv2.0
[platform/core/messaging/msg-service.git] / vobject-engine / include / vobject.h
1 /*
2  * msg-service
3  *
4  * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18 */
19
20 #ifndef _VOBJECT_H
21 #define _VOBJECT_H
22
23 #include "stdio.h"
24 #include "stdbool.h"
25 #include "stdlib.h"
26 #include "string.h"
27 #include "ctype.h"
28
29 #include <dlog.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34
35 //#define ORG_ENABLE_TRACE
36 #define FEATURE_SHIFT_JIS
37
38 #ifdef ORG_ENABLE_TRACE
39 #define USER_TAG "MSG_FW"
40 #define VDATA_TRACE(fmt, arg...) \
41         do\
42         {\
43                 SLOG(LOG_DEBUG, USER_TAG, "\n[calendarui] %s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##arg); \
44         } while (0)
45
46
47 #define VDATA_TRACE_LINE() fprintf(stderr, "\n[calendarui] %s:%d\n", __FUNCTION__, __LINE__ )
48
49 #define SysRequireEx(expr, retValue) \
50         if (!(expr)) { \
51                 fprintf(stderr,"INVALID_PARAM (%d lines in %s)\n", __LINE__,__FILE__); \
52                 return retValue; }\
53         else {;}
54 #else
55 #define VDATA_TRACE(fmt, arg...)
56 #define VDATA_TRACE_LINE()
57 #define SysRequireEx(expr, retValue)
58 #endif
59
60 #define VDATA_TRACE_BEGINE //VDATA_TRACE(">>>>>> start. >>>>>>"); //usleep(1000);
61 #define VDATA_TRACE_END //VDATA_TRACE(">>>>>> end. >>>>>>");
62
63 /****************************************************************************************************/
64 /*                                                                               FUNCTION DECLARATION                                                                           */
65 /****************************************************************************************************/
66 int             _VIsSpace( char );
67 int             _VRLSpace( char * );
68 int             _VRTSpace( char * );
69 int             _VUnescape( char* );
70 int             _VEscape(char*);
71 int             _VManySpace2Space( char * );
72 int             _VB64Decode( char *, char * );
73 int             _VB64Encode( char *, char *, int );
74 int             _VUnfolding( char * );
75 void    _VFolding( char *, char * );
76 int             _VQPDecode( char * );
77 int             _VQPEncode( char *, char * );
78
79 void _VFoldingQP( char *result, char *contentline );
80 void _VFoldingNoSpace( char *result, char *contentline );
81 int _VManyCRLF2CRLF(char *pIn);
82 int _VUnfoldingNoSpec( char *string, int vType );
83
84 #ifdef __cplusplus
85 }
86 #endif /* __cplusplus */
87
88 #endif