General Definitions for Asterisk top level program Included by asterisk.h to handle platform-specific issues especially those related to header files. More...
#include "asterisk/compiler.h"#include <inttypes.h>#include <limits.h>#include <unistd.h>#include <stddef.h>#include <stdint.h>#include <sys/types.h>#include <stdarg.h>#include <stdlib.h>#include <alloca.h>#include <stdio.h>#include <string.h>#include <sys/poll.h>#include <errno.h>#include <glob.h>

Go to the source code of this file.
Defines | |
| #define | __STDC_VERSION__ 0 |
| #define | MY_GLOB_FLAGS (GLOB_NOMAGIC | GLOB_BRACE) |
Functions | |
| size_t | strlcat (char *dst, const char *src, size_t siz) |
| size_t | strlcpy (char *dst, const char *src, size_t siz) |
General Definitions for Asterisk top level program Included by asterisk.h to handle platform-specific issues especially those related to header files.
Definition in file compat.h.
| #define MY_GLOB_FLAGS (GLOB_NOMAGIC | GLOB_BRACE) |
Definition at line 193 of file compat.h.
Referenced by config_text_file_load().
| size_t strlcat | ( | char * | dst, | |
| const char * | src, | |||
| size_t | siz | |||
| ) |
Definition at line 375 of file main/strcompat.c.
References s.
00376 { 00377 register char *d = dst; 00378 register const char *s = src; 00379 register size_t n = siz; 00380 size_t dlen; 00381 00382 /* Find the end of dst and adjust bytes left but don't go past end */ 00383 while (n-- != 0 && *d != '\0') 00384 d++; 00385 dlen = d - dst; 00386 n = siz - dlen; 00387 00388 if (n == 0) 00389 return dlen + strlen(s); 00390 00391 while (*s != '\0') { 00392 if (n != 1) { 00393 *d++ = *s; 00394 n--; 00395 } 00396 s++; 00397 } 00398 *d = '\0'; 00399 00400 return dlen + (s - src); /* count does not include NUL */ 00401 }
| size_t strlcpy | ( | char * | dst, | |
| const char * | src, | |||
| size_t | siz | |||
| ) |
Definition at line 439 of file main/strcompat.c.
References s.
00440 { 00441 register char *d = dst; 00442 register const char *s = src; 00443 register size_t n = siz; 00444 00445 /* Copy as many bytes as will fit */ 00446 if (n != 0 && --n != 0) { 00447 do { 00448 if ((*d++ = *s++) == 0) 00449 break; 00450 } while (--n != 0); 00451 } 00452 00453 /* Not enough room in dst, add NUL and traverse rest of src */ 00454 if (n == 0) { 00455 if (siz != 0) 00456 *d = '\0'; /* NUL-terminate dst */ 00457 while (*s++) 00458 ; 00459 } 00460 00461 return s - src - 1; /* count does not include NUL */ 00462 }
1.6.1