本文整理汇总了C++中skip_line函数的典型用法代码示例。如果您正苦于以下问题:C++ skip_line函数的具体用法?C++ skip_line怎么用?C++ skip_line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skip_line函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse_delete
int parse_delete(FILE * file, int * number)
{
bool succeed =
0 <= (*number = parse_index(file)) &&
0 == parse_endl(file)
;
skip_line(file);
return succeed ? 0 : -1;
}
示例2: parse_find
int parse_find(FILE * file, char * out_pattern, const int limit)
{
bool succeed =
0 == parse_word(file, out_pattern, limit) &&
0 == parse_endl(file)
;
skip_line(file);
return succeed ? 0 : -1;
}
示例3: page_length
void page_length()
{
vunits n;
if (has_arg() && get_vunits(&n, 'v', topdiv->get_page_length()))
topdiv->set_page_length(n);
else
topdiv->set_page_length(11*units_per_inch);
skip_line();
}
示例4: parse_insert
int parse_insert(FILE * file, char * out_word, const int limit)
{
bool succeed =
0 == parse_word(file, out_word, limit) &&
0 == parse_endl(file)
;
skip_line(file);
return succeed ? 0 : -1;
}
示例5: read_vert
inline void
read_vert(LMESH* mesh, istream& in)
{
double x, y, z;
in >> x >> y >> z;
skip_line(in);
assert(mesh);
mesh->add_vertex(Wpt(x,y,z));
}
示例6: skip_white
void skip_white (char **start, char *end)
{
while (*start < end && (isspace (**start) || **start == '%')) {
if (**start == '%')
skip_line (start, end);
else /* Skip the white char */
(*start)++;
}
return;
}
示例7: parse_and_print_to_stdout
int parse_and_print_to_stdout(const char * operation)
{
if (NULL == operation)
{
skip_line(stdin);
return -1;
}
if (0 == strcmp(OP_INSERT, operation))
{
if (0 != parse_insert(stdin, word_buffer, MAX_WORD_LEN))
return -1;
int word_num = trie_insert(word_buffer);
if (word_num < 0)
return -1;
printf("word number: %d\n", word_num);
}
if (0 == strcmp(OP_PREV, operation))
{
int number, start, end;
if (0 != parse_prev(stdin, &number, &start, &end))
return -1;
int word_num = trie_prev(number, start, end);
if (word_num < 0)
return -1;
printf("word number: %d\n", word_num);
}
if (0 == strcmp(OP_DELETE, operation))
{
int number;
if (0 != parse_delete(stdin, &number))
return -1;
int word_num = trie_delete(number);
if (word_num < 0)
return -1;
printf("deleted: %d\n", number);
}
if (0 == strcmp(OP_FIND, operation))
{
if (0 != parse_find(stdin, word_buffer, MAX_WORD_LEN))
return -1;
int find_result = trie_find(word_buffer, strlen(word_buffer));
if (find_result < 0)
return -1;
puts(find_result == 0 ? "YES" : "NO");
}
if (0 == strcmp(OP_CLEAR, operation))
{
if (0 != parse_clear(stdin))
return -1;
if (0 != trie_clear())
return -1;
puts("cleared");
}
return 0;
}
示例8: grab
static struct ptr_valid_map *get_proc_maps(unsigned int *num)
{
char *buf, *p;
struct ptr_valid_map *map;
unsigned int max = 16;
buf = grab("/proc/self/maps");
if (!buf) {
*num = 0;
return NULL;
}
map = malloc(sizeof(*map) * max);
if (!map)
goto free_buf;
*num = 0;
for (p = buf; p && *p; p = skip_line(p)) {
unsigned long start, end;
char *endp;
/* Expect '<start-in-hex>-<end-in-hex> rw... */
start = strtoul(p, &endp, 16);
if (*endp != '-')
goto malformed;
end = strtoul(endp+1, &endp, 16);
if (*endp != ' ')
goto malformed;
endp++;
if (endp[0] != 'r' && endp[0] != '-')
goto malformed;
if (endp[1] != 'w' && endp[1] != '-')
goto malformed;
/* We only add readable mappings. */
if (endp[0] == 'r') {
map = add_map(map, num, &max, start, end,
endp[1] == 'w');
if (!map)
goto free_buf;
}
}
free(buf);
return map;
malformed:
free(map);
free_buf:
free(buf);
*num = 0;
return NULL;
}
示例9: parse_prev
int parse_prev(FILE * file, int * number, int * start, int * end)
{
bool succeed =
0 <= (*number = parse_index(file)) &&
0 <= (*start = parse_index(file)) &&
0 <= (*end = parse_index(file)) &&
0 == parse_endl(file)
;
skip_line(file);
return succeed ? 0 : -1;
}
示例10: main
int main()
{
int numtests;
input = fopen("ai.in","r");
assert(input!=NULL);
fscanf(input,"%d",&numtests);
skip_line();
while (numtests--) solve_case();
fclose(input);
return 0;
}
示例11: mark
void mark()
{
symbol s = get_name();
if (s.is_null())
curdiv->marked_place = curdiv->get_vertical_position();
else if (curdiv == topdiv)
set_number_reg(s, nl_reg_contents);
else
set_number_reg(s, curdiv->get_vertical_position().to_units());
skip_line();
}
示例12: save_vertical_space
void save_vertical_space()
{
vunits x;
if (!has_arg() || !get_vunits(&x, 'v'))
x = curenv->get_vertical_spacing();
if (curdiv->distance_to_next_trap() > x)
curdiv->space(x, 1);
else
saved_space = x;
skip_line();
}
示例13: vips__matrix_header
/* Read the header. Two numbers for width and height, and two optional
* numbers for scale and offset.
*/
static int
vips__matrix_header( char *whitemap, FILE *fp,
int *width, int *height, double *scale, double *offset )
{
double header[4];
double d;
int i;
int ch;
for( i = 0; i < 4 &&
(ch = read_ascii_double( fp, whitemap, &header[i] )) == 0;
i++ )
;
if( i < 2 ) {
vips_error( "mask2vips", "%s", _( "no width / height" ) );
return( -1 );
}
if( floor( header[0] ) != header[0] ||
floor( header[1] ) != header[1] ) {
vips_error( "mask2vips", "%s", _( "width / height not int" ) );
return( -1 );
}
*width = header[0];
*height = header[1];
if( *width <= 0 ||
*width > 100000 ||
*height <= 0 ||
*height > 100000 ) {
vips_error( "mask2vips",
"%s", _( "width / height out of range" ) );
return( -1 );
}
if( i == 3 ) {
vips_error( "mask2vips", "%s", _( "bad scale / offset" ) );
return( -1 );
}
if( (ch = read_ascii_double( fp, whitemap, &d )) != '\n' ) {
vips_error( "mask2vips", "%s", _( "extra chars in header" ) );
return( -1 );
}
if( i > 2 &&
header[2] == 0.0 ) {
vips_error( "mask2vips", "%s", _( "zero scale" ) );
return( -1 );
}
*scale = i > 2 ? header[2] : 1.0;
*offset = i > 2 ? header[3] : 0.0;
skip_line( fp );
return( 0 );
}
示例14: skip_whitespace_comments
void
skip_whitespace_comments (FILE *fp)
/* skips over all whitespace and comments, if any */
{
skip_whitespace (fp);
while (nextchar == '#') {
skip_line (fp);
if (nextchar != EOF)
skip_whitespace (fp);
}
}
示例15: skip_comments
// skip_comments(is) utilise la fonction précédente pour sauter zéro, une ou plusieurs lignes
// de commentaires débutées par '#' et allant jusqu'à '\n'.
static void skip_comments(std::istream& is)
{
char c;
is.get(c); // Lire un caractère.
while(c=='#') // Tant que c'est un '#'.
{
skip_line(is); // On élimine les caractères jusqu'à la fin de ligne,
is.get(c); // Et on lit un nouveau caractère.
}
is.putback(c); // On remet le caractère lu puisqu'il n'est pas un '#'.
}