1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef XPL_STRINGUTIL_H
18#define XPL_STRINGUTIL_H
19
20/**
21    \file xpl_StringUtil.h
22    \brief The xpl_StringUtil.h header file contains function prototypes for basic string operations.
23    <b>Warning:</b>   All functions, structures, and classes from this header file are for internal usage only!!!
24*/
25
26/************** HEADER FILE INCLUDES *****************************************/
27#include "stdlib.h"
28#include "string.h"
29#include "stdio.h"
30#include "xpl_Types.h"
31
32/************** FUNCTIONS ****************************************************/
33
34/** Definition function xplStrlen for cross platform support*/
35#define xplStrlen(str) ((str!=XPL_NULL)? strlen(str):0)
36
37/** Definition function xplStrcpy for cross platform support*/
38#define xplStrcpy(target, source) strcpy(target, source)
39
40/** Definition function xplStrncpy for cross platform support*/
41#define xplStrncpy(target, source, count) strncpy(target, source, count)
42
43/** Definition function xplStrcat for cross platform support*/
44#define xplStrcat(target, source) strcat(target, source)
45
46/** Definition function xplStrncat for cross platform support*/
47#define xplStrncat(target, source, count) strncat(target, source, count)
48
49/** Definition function xplStrcmp for cross platform support*/
50#define xplStrcmp(target, source) strcmp(target, source)
51
52/** Definition function xplStrncmp for cross platform support*/
53#define xplStrncmp(target, source, count) strncmp(target, source, count)
54
55/** Definition function xplStrchr for cross platform support*/
56#define xplStrchr(source, target) strchr(source, target)
57
58/** Definition function xplStrrchr for cross platform support*/
59#define xplStrrchr(source, target) strrchr(source, target)
60
61/** Definition function xplStrstr for cross platform support*/
62#define xplStrstr(source, target) strstr(source, target)
63
64/** Definition function xplTolower for cross platform support*/
65#define xplTolower(source) tolower(source)
66
67/** Definition function xplAtoi for cross platform support*/
68#define xplAtoi(source) atoi(source)
69
70/** Definition function xplAtol for cross platform support*/
71#define xplAtol(source) atol(source)
72
73/** Definition function xplAtoll for cross platform support*/
74#define xplAtoll(source) atoll(source)
75
76/** Definition function xplSprintf for cross platform support*/
77#define xplSprintf sprintf
78
79/** Definition function xplSnprintf for cross platform support*/
80#define xplSnprintf snprintf
81
82/** Definition function xplSscanf for cross platform support*/
83#define xplSscanf sscanf
84
85#endif /* XPL_STRINGUTIL_H */
86