summaryrefslogtreecommitdiffstats
path: root/macro.h
diff options
context:
space:
mode:
authorSuper User2008-06-06 15:18:59 +0200
committerSuper User2008-06-06 15:18:59 +0200
commitcbc232643c7b26d64204ba7f6151007e9c0267e4 (patch)
treede9d04deac87922f6e8a6a6e0f1e4654d12a0706 /macro.h
parentfixed bad bug in opening bchannel (diff)
downloadlcr-cbc232643c7b26d64204ba7f6151007e9c0267e4.tar.gz
lcr-cbc232643c7b26d64204ba7f6151007e9c0267e4.tar.xz
lcr-cbc232643c7b26d64204ba7f6151007e9c0267e4.zip
work on chan_lcr: bridging works, interface selection possible
modified: Makefile modified: apppbx.cpp modified: apppbx.h modified: bchannel.c modified: bchannel.h modified: chan_lcr.c modified: chan_lcr.h modified: dss1.cpp modified: genext.c modified: joinremote.cpp modified: joinremote.h modified: mISDN.cpp modified: mISDN.h modified: macro.h modified: main.c modified: message.h modified: options.c modified: options.h modified: socket_server.c
Diffstat (limited to 'macro.h')
-rw-r--r--macro.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/macro.h b/macro.h
index 9bb1f29..07921e0 100644
--- a/macro.h
+++ b/macro.h
@@ -11,28 +11,28 @@
\*****************************************************************************/
-/* save strcpy/strncpy */
+/* safe strcpy/strncpy */
#define SCPY(dst, src) scpy(dst, src, sizeof(dst))
-extern __inline__ void scpy(char *dst, char *src, unsigned int siz)
+static inline void scpy(char *dst, char *src, unsigned int siz)
{
strncpy(dst, src, siz);
dst[siz-1] = '\0';
}
-/* save strcat/strncat */
+/* safe strcat/strncat */
#define SCAT(dst, src) scat(dst, src, sizeof(dst))
-extern __inline__ void scat(char *dst, char *src, unsigned int siz)
+static inline void scat(char *dst, char *src, unsigned int siz)
{
strncat(dst, src, siz);
dst[siz-1] = '\0';
}
-/* save concat of a byte */
+/* safe concat of a byte */
#define SCCAT(dst, src) sccat(dst, src, sizeof(dst))
-extern __inline__ void sccat(char *dst, char chr, unsigned int siz)
+static inline void sccat(char *dst, char chr, unsigned int siz)
{
if (strlen(dst) < siz-1)
{
@@ -41,10 +41,10 @@ extern __inline__ void sccat(char *dst, char chr, unsigned int siz)
}
}
-/* save sprintf/snprintf */
+/* safe sprintf/snprintf */
#define SPRINT(dst, fmt, arg...) sprint(dst, sizeof(dst), fmt, ## arg)
-extern __inline__ void sprint(char *dst, unsigned int siz, char *fmt, ...)
+static inline void sprint(char *dst, unsigned int siz, char *fmt, ...)
{
va_list args;
@@ -54,7 +54,7 @@ extern __inline__ void sprint(char *dst, unsigned int siz, char *fmt, ...)
va_end(args);
}
-/* unsave */
+/* unsafe */
#define UCPY strcpy
#define UNCPY strncpy
#define UCAT strcat
@@ -65,7 +65,7 @@ extern __inline__ void sprint(char *dst, unsigned int siz, char *fmt, ...)
/* fatal error with error message and exit */
#define FATAL(fmt, arg...) fatal(__FUNCTION__, __LINE__, fmt, ##arg)
-extern __inline__ void fatal(const char *function, int line, char *fmt, ...)
+static inline void fatal(const char *function, int line, char *fmt, ...)
{
va_list args;
char buffer[256];
@@ -85,7 +85,7 @@ extern __inline__ void fatal(const char *function, int line, char *fmt, ...)
/* memory allocation with setting to zero */
#define MALLOC(size) _malloc(size, __FUNCTION__, __LINE__)
-extern __inline__ void *_malloc(unsigned long size, const char *function, int line)
+static inline void *_malloc(unsigned long size, const char *function, int line)
{
void *addr;
addr = malloc(size);
@@ -97,7 +97,7 @@ extern __inline__ void *_malloc(unsigned long size, const char *function, int li
/* memory freeing with clearing memory to prevent using freed memory */
#define FREE(addr, size) _free(addr, size)
-extern __inline void _free(void *addr, int size)
+static inline void _free(void *addr, int size)
{
if (size)
memset(addr, 0, size);