RTEMS CPU Kit with SuperCore  4.11.3
Macros | Functions
vis.c File Reference
#include <sys/types.h>
#include <vis.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for vis.c:

Macros

#define _DIAGASSERT(a)
 
#define BELL   '\a'
 
#define isoctal(c)   (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
 
#define iswhite(c)   (c == ' ' || c == '\t' || c == '\n')
 
#define issafe(c)   (c == '\b' || c == BELL || c == '\r')
 
#define xtoa(c)   "0123456789abcdef"[c]
 
#define MAXEXTRAS   5
 
#define MAKEEXTRALIST(flag, extra, orig)
 
#define HVIS(dst, c, flag, nextc, extra)
 
#define SVIS(dst, c, flag, nextc, extra)
 

Functions

char * svis (char *dst, int c, int flag, int nextc, const char *extra)
 
int strsvis (char *dst, const char *csrc, int flag, const char *extra)
 
int strsvisx (char *dst, const char *csrc, size_t len, int flag, const char *extra)
 
char * vis (char *dst, int c, int flag, int nextc)
 
int strvis (char *dst, const char *src, int flag)
 
int strvisx (char *dst, const char *src, size_t len, int flag)
 

Macro Definition Documentation

◆ HVIS

#define HVIS (   dst,
  c,
  flag,
  nextc,
  extra 
)
Value:
do \
if (!isascii(c) || !isalnum(c) || strchr("$-_.+!*'(),", c) != NULL) { \
*dst++ = '%'; \
*dst++ = xtoa(((unsigned int)c >> 4) & 0xf); \
*dst++ = xtoa((unsigned int)c & 0xf); \
} else { \
SVIS(dst, c, flag, nextc, extra); \
} \
while (/*CONSTCOND*/0)

◆ MAKEEXTRALIST

#define MAKEEXTRALIST (   flag,
  extra,
  orig 
)
Value:
do { \
const char *o = orig; \
char *e; \
while (*o++) \
continue; \
extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \
if (!extra) break; \
for (o = orig, e = extra; (*e++ = *o++) != '\0';) \
continue; \
e--; \
if (flag & VIS_SP) *e++ = ' '; \
if (flag & VIS_TAB) *e++ = '\t'; \
if (flag & VIS_NL) *e++ = '\n'; \
if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \
*e = '\0'; \
} while (/*CONSTCOND*/0)