本文整理汇总了C++中SKIP_SPACE函数的典型用法代码示例。如果您正苦于以下问题:C++ SKIP_SPACE函数的具体用法?C++ SKIP_SPACE怎么用?C++ SKIP_SPACE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SKIP_SPACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtsp_decode_header
static void rtsp_decode_header (const char *line, rtsp_resp_t *response, rtsp_client_t* client)
{
int i;
const char *after;
i = 0;
while (header_types[i].val != 0)
{
if (strncasecmp(line, header_types[i].val, header_types[i].val_length) == 0)
{
after = line + header_types[i].val_length;
SKIP_SPACE(after);
if (*after == ':')
{
after++;
SKIP_SPACE(after);
(header_types[i].parse_routine)(after, response,client);
return;
}
}
i++;
}
RTSP_ALERT("%s [not processing]\n", line);
}
示例2: epd_pv_plies
static int /* 0 | ply depth of pv ending with '#' */
epd_pv_plies( EpdJob* ejp )
{
register char* p;
register char* q;
int plies;
plies = 0;
q = 0;
p = epd_find_op_opnds(ejp, "pv");
if( p ) {
SKIP_SPACE(p);
while( *p ) {
plies += 1;
while( *p && !IS_SPACE(*p) ) {
q = p; ++p;
}
SKIP_SPACE(p);
}
if( !q || (q[0] != '#') ) { /* no mate indicator at end ... */
plies = 0; /* ... so we know nothing */
}
}
return plies;
}
示例3: SKIP_SPACE
/*
* Internal buffer looks like this.
* num[0] op[0] num[1] op[1] num[2]
* If priority of op[0] is higher than op[1], (num[0] op[0] num[1]) is computed,
* otherwise (num[1] op[1] num[2]) is computed.
* Then, the next op and num is read from the script.
* Num is an immediate value, a variable or a bracketed expression.
*/
void ScriptHandler::readNextOp(const char** buf, int* op, int* num)
{
bool minus_flag = false;
SKIP_SPACE(*buf);
const char* buf_start = *buf;
if (op) {
if ((*buf)[0] == '+') *op = OP_PLUS;
else if ((*buf)[0] == '-') *op = OP_MINUS;
else if ((*buf)[0] == '*') *op = OP_MULT;
else if ((*buf)[0] == '/') *op = OP_DIV;
else if ((*buf)[0] == 'm'
&& (*buf)[1] == 'o'
&& (*buf)[2] == 'd'
&& ((*buf)[3] == ' '
|| (*buf)[3] == '\t'
|| (*buf)[3] == '$'
|| (*buf)[3] == '%'
|| (*buf)[3] == '?'
|| ((*buf)[3] >= '0' && (*buf)[3] <= '9')))
*op = OP_MOD;
else {
*op = OP_INVALID;
return;
}
if (*op == OP_MOD) *buf += 3;
else (*buf)++;
SKIP_SPACE(*buf);
}
else {
if ((*buf)[0] == '-') {
minus_flag = true;
(*buf)++;
SKIP_SPACE(*buf);
}
}
if ((*buf)[0] == '(') {
(*buf)++;
*num = parseIntExpression(buf);
if (minus_flag) *num = -*num;
SKIP_SPACE(*buf);
if ((*buf)[0] != ')') errorAndExit(") is not found.");
(*buf)++;
}
else {
*num = parseInt(buf);
if (minus_flag) *num = -*num;
if (current_variable.type == VAR_NONE) {
if (op) *op = OP_INVALID;
*buf = buf_start;
}
}
}
示例4: ImportLoadFile
static void ImportLoadFile (void)
{
char *filename = NULL;
char space[] = " \t\n";
char *IncPath[] = {
".",
#define INC_PATH(path) path,
#include "confg/inc_path.h"
#undef INC_PATH
NULL
};
SKIP_SPACE (space);
filename = CURRENT;
while (';' != *CURRENT && END_OF_FILE != *CURRENT)
CURRENT++;
filename = InternStr (filename, (char*)CURRENT - filename);
if (';' != *CURRENT) {
Error (&TokenCoord, "Expect ;");
} else CURRENT++;
/* 读到下一个不为空的字符 */
SKIP_SPACE (space);
FindAndLoadFile (filename, IncPath);
}
示例5: get_command
static void get_command(char *line, char *com, char *arg1, char *arg2)
{
char *s;
*com = *arg1 = *arg2 = '\0';
SKIP_SPACE();
GET_ARG(com);
SKIP_SPACE();
GET_ARG(arg1);
SKIP_SPACE();
GET_ARG(arg2);
}
示例6: SKIP_SPACE
static char *xml_meta_attr_value(ACL_XML3_ATTR *attr, char *data)
{
ACL_XML3 *xml = attr->node->xml;
int ch;
SKIP_SPACE(data);
if (IS_QUOTE(*data))
attr->quote = *data++;
if (*data == 0)
return data;
if (attr->value == xml->addr)
attr->value = data;
while ((ch = *data) != 0) {
if (attr->quote && ch == attr->quote) {
attr->value_size = data - attr->value;
*data++ = 0;
break;
} else if (IS_SPACE(ch)) {
attr->value_size = data - attr->value;
*data++ = 0;
break;
}
data++;
}
return data;
}
示例7: SKIP_SPACE
static const char *json_element(ACL_JSON *json, const char *data)
{
/* 创建数组成员对象 */
ACL_JSON_NODE *element;
SKIP_SPACE(data);
if (*data == 0)
return NULL;
if (*data == '{') {
data++;
json->status = ACL_JSON_S_OBJ;
return data;
} else if (*data == '[') {
data++;
json->status = ACL_JSON_S_ARRAY;
return data;
}
element = acl_json_node_alloc(json);
element->type = ACL_JSON_T_ELEMENT;
element->depth = json->curr_node->depth + 1;
if (element->depth > json->depth)
json->depth = element->depth;
acl_json_node_add_child(json->curr_node, element);
/* 将该数组成员对象置为当前 JSON 分析结点 */
json->curr_node = element;
json->status = ACL_JSON_S_VALUE;
return data;
}
示例8: xml_meta_attr
static void xml_meta_attr(ACL_XML2_NODE *node)
{
ACL_XML2_ATTR *attr;
char *ptr;
int ch;
if (node->text == node->xml->addr || *node->text == 0)
return;
ptr = node->text;
SKIP_SPACE(ptr);
if (*ptr == 0)
return;
while ((ch = *ptr) != 0) {
attr = acl_xml2_attr_alloc(node);
ptr = xml_meta_attr_name(attr, ptr);
if (*ptr == 0)
break;
ptr = xml_meta_attr_value(attr, ptr);
if (*ptr == 0)
break;
}
node->text = node->xml->addr;
node->text_size = 0;
}
示例9: SKIP_SPACE
const char *ScriptHandler::readStr()
{
end_status = END_NONE;
current_variable.type = VAR_NONE;
current_script = next_script;
SKIP_SPACE( current_script );
char *buf = current_script;
string_buffer[0] = '\0';
string_counter = 0;
while(1){
parseStr(&buf);
buf = checkComma(buf);
string_counter += strlen(str_string_buffer);
if (string_counter+1 >= STRING_BUFFER_LENGTH)
errorAndExit("readStr: string length exceeds 2048 bytes.");
strcat(string_buffer, str_string_buffer);
if (buf[0] != '+') break;
buf++;
}
next_script = buf;
return string_buffer;
}
示例10: SKIP_SPACE
static char *xml_meta_attr_name(ACL_XML2_ATTR *attr, char *data)
{
int ch;
ACL_XML2 *xml = attr->node->xml;
SKIP_SPACE(data);
if (*data == 0)
return data;
if (attr->name == xml->addr)
attr->name = data;
while ((ch = *data) != 0) {
if (ch == '=') {
if (attr->name_size == 0)
attr->name_size = data - attr->name;
*data++ = 0;
break;
}
if (IS_SPACE(ch)) {
attr->name_size = data - attr->name;
*data++ = 0;
} else
data++;
}
return data;
}
示例11: SKIP_SPACE
static const char *xml_parse_left_tag(ACL_XML2 *xml, const char *data)
{
int ch;
if (xml->curr_node->ltag == xml->dummy)
SKIP_SPACE(data);
if (*data == 0)
return data;
if (xml->curr_node->ltag == xml->dummy)
xml->curr_node->ltag = END(xml);
while ((ch = *data) != 0) {
if (ch == '>') {
if (NO_SPACE(xml))
return data;
xml->curr_node->ltag_size =
END(xml) - xml->curr_node->ltag;
ADD(xml, '\0');
data++;
xml_parse_check_self_closed(xml);
if ((xml->curr_node->flag & ACL_XML2_F_SELF_CL)
&& xml->curr_node->last_ch == '/')
{
if (xml->curr_node->ltag_size > 0) {
size_t n;
xml->curr_node->ltag_size--;
n = xml->curr_node->ltag_size;
xml->curr_node->ltag[n] = 0;
}
xml->curr_node->status = ACL_XML2_S_RGT;
} else
xml->curr_node->status = ACL_XML2_S_LGT;
break;
} else if (IS_SPACE(ch)) {
if (NO_SPACE(xml))
return data;
data++;
xml->curr_node->ltag_size =
END(xml) - xml->curr_node->ltag;
ADD(xml, '\0');
xml->curr_node->status = ACL_XML2_S_ATTR;
xml->curr_node->last_ch = ch;
break;
} else {
if (NO_SPACE(xml))
return data;
data++;
ADD(xml, ch);
xml->curr_node->last_ch = ch;
}
}
return data;
}
示例12: ScanPPEndif
static void ScanPPEndif (void)
{
if (endifCnt <= 0)
Error (&TokenCoord, "undef use error!");
else endifCnt--;
SKIP_SPACE (" \t\n");
}
示例13: SKIP_SPACE
/*
* Read key blob from string buffer (null terminated) and convert it to
* binary format. Returns xmallocated blob, and if blob_len, version_major,
* version_minor, or is_public have non NULL value the length of blob,
* major and minor version numbers of format, and whatever the blob was
* private or public key are returned.
*/
unsigned char *ssh_key_blob_read_from_string(const char *str,
size_t *blob_len,
char **headers,
unsigned int *version_major,
unsigned int *version_minor,
Boolean *is_public)
{
unsigned char *blob, *blob2;
const char *base64blob, *crc64blob;
unsigned int number;
size_t base64blob_len, crc64blob_len;
const char *p, *compare, *again, *headers_beg, *headers_end;
unsigned char *p2;
Boolean public;
SshUInt32 crc32;
if (version_major != NULL)
*version_major = 0;
if (version_minor != NULL)
*version_minor = 0;
if (blob_len != NULL)
*blob_len = 0;
p = str;
#define SKIP_SPACE(p) \
do { while (isspace(*(p))) (p)++; } while (0)
#define EXPECT_CHAR(p,ch) \
do { if (*(p) != (ch)) goto error; } while (0)
#define SKIP_CHARS(p,ch) \
do { while (*(p) == (ch) || isspace(*(p))) (p)++; } while (0)
#define MATCH_STRING(p,str) \
do { for(; *(p) && *(str) == tolower(*(p));(str)++) { (p)++; SKIP_SPACE(p);}\
} while (0)
#define MATCH_STRING_GOTO_ERROR(p,str) \
do { MATCH_STRING((p),(str)); if (*(str)) goto error; } while (0)
#define READ_NUMBER(p,n) \
do { (n) = 0; SKIP_SPACE(p); for(; isdigit(*(p)); ) \
{ (n) = ((n) * 10) + (*(p) - '0'); (p)++; SKIP_SPACE(p); } } while (0)
SKIP_SPACE(p);
/* Read begin line */
EXPECT_CHAR(p, '-');
SKIP_CHARS(p, '-');
compare = "beginssh";
MATCH_STRING_GOTO_ERROR(p, compare);
again = p;
compare = "public";
MATCH_STRING(p, compare);
if (*compare)
{
p = again;
compare = "private";
MATCH_STRING_GOTO_ERROR(p, compare);
public = FALSE;
}
示例14: getPlatformTimeZoneID
/*
* Performs Solaris dependent mapping. Returns a zone ID if
* found. Otherwise, NULL is returned. Solaris libc looks up
* "/etc/default/init" to get the default TZ value if TZ is not defined
* as an environment variable.
*/
static char *
getPlatformTimeZoneID()
{
char *tz = NULL;
FILE *fp;
/*
* Try the TZ entry in /etc/default/init.
*/
if ((fp = fileopen(SYS_INIT_FILE, "r")) != NULL) {
char line[256];
char quote = '\0';
while (filegets(line, sizeof(line), fp) != NULL) {
char *p = line;
char *s;
char c;
/* quick check for comment lines */
if (*p == '#') {
continue;
}
if (strncmp(p, "TZ=", 3) == 0) {
p += 3;
SKIP_SPACE(p);
c = *p;
if (c == '"' || c == '\'') {
quote = c;
p++;
}
/*
* PSARC/2001/383: quoted string support
*/
for (s = p; (c = *s) != '\0' && c != '\n'; s++) {
/* No '\\' is supported here. */
if (c == quote) {
quote = '\0';
break;
}
if (c == ' ' && quote == '\0') {
break;
}
}
if (quote != '\0') {
jio_fprintf(stderr, "ZoneInfo: unterminated time zone name in /etc/TIMEZONE\n");
}
*s = '\0';
tz = strdup(p);
break;
}
}
(void) fileclose(fp);
}
return tz;
}
示例15: SKIP_SPACE
static const char *xml_meta_attr_value(ACL_XML_ATTR *attr, const char *data)
{
int ch;
SKIP_SPACE(data);
if (*data == 0)
return data;
if (IS_QUOTE(*data))
attr->quote = *data++;
while ((ch = *data) != 0) {
if (attr->backslash) {
if (ch == 'b')
ADDCH(attr->value, '\b');
else if (ch == 'f')
ADDCH(attr->value, '\f');
else if (ch == 'n')
ADDCH(attr->value, '\n');
else if (ch == 'r')
ADDCH(attr->value, '\r');
else if (ch == 't')
ADDCH(attr->value, '\t');
else
ADDCH(attr->value, ch);
attr->backslash = 0;
} else if (ch == '\\') {
if (attr->part_word) {
ADDCH(attr->value, ch);
attr->part_word = 0;
} else
attr->backslash = 1;
} else if (attr->quote) {
if (ch == attr->quote) {
data++;
break;
}
ADDCH(attr->value, ch);
} else if (IS_SPACE(ch)) {
data++;
break;
} else {
ADDCH(attr->value, ch);
if ((attr->node->xml->flag & ACL_XML_FLAG_PART_WORD)) {
if (attr->part_word)
attr->part_word = 0;
else if (ch < 0)
attr->part_word = 1;
}
}
data++;
}
ACL_VSTRING_TERMINATE(attr->value);
return data;
}