1 | /**** |
---|
2 | Copyright 2015 Alexej Magura |
---|
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 | #if !defined(RDLN_FOREIGN_H_GUARD) |
---|
17 | # define RDLN_FOREIGN_H_GUARD 1 |
---|
18 | /* BEGIN_C_DECLS should be used at the beginning of your declarations, |
---|
19 | so that C++ compilers don't mangle their names. Use END_C_DECLS at |
---|
20 | the end of C declarations. */ |
---|
21 | # undef BEGIN_C_DECLS |
---|
22 | # undef END_C_DECLS |
---|
23 | # ifdef __cplusplus |
---|
24 | # define BEGIN_C_DECLS extern "C" { |
---|
25 | # define END_C_DECLS } |
---|
26 | # else |
---|
27 | # define BEGIN_C_DECLS /* empty */ |
---|
28 | # define END_C_DECLS /* empty */ |
---|
29 | # endif |
---|
30 | |
---|
31 | /* PARAMS is a macro used to wrap function prototypes, so that |
---|
32 | compilers that don't understand ANSI C prototypes still work, |
---|
33 | and ANSI C compilers can issue warnings about type mismatches. */ |
---|
34 | # undef PARAMS |
---|
35 | # if defined (__STDC__) || defined (_AIX) \ |
---|
36 | || (defined (__mips) && defined (_SYSTYPE_SVR4)) \ |
---|
37 | || defined(WIN32) || defined(__cplusplus) |
---|
38 | # define PARAMS(protos) protos |
---|
39 | # else |
---|
40 | # define PARAMS(protos) () |
---|
41 | # endif |
---|
42 | |
---|
43 | BEGIN_C_DECLS |
---|
44 | |
---|
45 | # include <stdio.h> |
---|
46 | |
---|
47 | char *concat PARAMS((const char *s1, ...)); |
---|
48 | size_t concatl PARAMS((char *dst, size_t sz, const char *s1, ...)); |
---|
49 | size_t concatm PARAMS((char *dst, size_t sz, const char *s1, ...)); |
---|
50 | |
---|
51 | char cpeek PARAMS((const char *c, const char *s, const short fwd)); |
---|
52 | |
---|
53 | int *strndelim PARAMS((const char *s, const char od, const char cd, int count[2])); |
---|
54 | |
---|
55 | char *strwodqp PARAMS((const char *src)); |
---|
56 | |
---|
57 | # define cat(...) (concat(__VA_ARGS__, (void *)NULL)) |
---|
58 | # define catl(...) (concatl(__VA_ARGS__, (void *)NULL)) |
---|
59 | # define catm(...) (concatm(__VA_ARGS__, (void *)NULL)) |
---|
60 | |
---|
61 | END_C_DECLS |
---|
62 | |
---|
63 | #endif |
---|