本文整理汇总了C++中skip_line函数的典型用法代码示例。如果您正苦于以下问题:C++ skip_line函数的具体用法?C++ skip_line怎么用?C++ skip_line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skip_line函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Pand9,项目名称:IPP-2015-1,代码行数:9,代码来源:parse.c
示例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;
}
开发者ID:Pand9,项目名称:IPP-2015-1,代码行数:9,代码来源:parse.c
示例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();
}
开发者ID:Distrotech,项目名称:groff,代码行数:9,代码来源:div.cpp
示例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;
}
开发者ID:Pand9,项目名称:IPP-2015-1,代码行数:9,代码来源:parse.c
示例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));
}
开发者ID:ArnaudGastinel,项目名称:jot-lib,代码行数:9,代码来源:obj2jot.C
示例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;
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:10,代码来源:pdfparse.c
示例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;
}
开发者ID:Pand9,项目名称:IPP-2015-1,代码行数:55,代码来源:dictionary.c
示例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;
}
开发者ID:mvanga,项目名称:worlds,代码行数:55,代码来源:ptr_valid.c
示例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;
}
开发者ID:Pand9,项目名称:IPP-2015-1,代码行数:11,代码来源:parse.c
示例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;
}
开发者ID:cen5bin,项目名称:acm,代码行数:11,代码来源:ai.c
示例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();
}
开发者ID:Distrotech,项目名称:groff,代码行数:11,代码来源:div.cpp
示例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();
}
开发者ID:Distrotech,项目名称:groff,代码行数:11,代码来源:div.cpp
示例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 );
}
开发者ID:binarytemple,项目名称:debian-vips,代码行数:57,代码来源:csv.c
示例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);
}
}
开发者ID:BrianGladman,项目名称:MPC,代码行数:11,代码来源:read_data.c
示例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 '#'.
}
开发者ID:guillaume-gomez,项目名称:Rep-Code,代码行数:13,代码来源:Image.hpp
示例16: read_next_task
void read_next_task(STREAM *file, TODOLIST *list) {
char c;
char *message = NULL;
int done = 0;
int priority = 0;
skip_whitespace(file);
c = stream_getc(file);
if (c != '[') {
if (c == '#') {
read_next_option(file, list);
skip_line(file);
return;
}
stream_ungetc(c, file);
skip_line(file);
return;
}
c = stream_getc(file);
switch (c) {
case 'X':
case 'x':
done = 1;
break;
case ' ':
done = 0;
break;
default:
stream_ungetc(c, file);
skip_line(file);
return;
}
c = stream_getc(file);
if (c != ']') {
stream_ungetc(c, file);
skip_line(file);
return;
}
skip_whitespace(file);
message = read_string(file);
add_task(list, message, done, priority);
}
开发者ID:nielssp,项目名称:ctodo,代码行数:41,代码来源:file.c
示例17: get_param
bool get_param (void) {
if (key_pending [0] != '\0') {
strcpy (key, key_pending); strcpy (area, parameter_pending);
key_pending [0] = parameter_pending [0] = '\0';
return true;
}
if (* command <= 32) {skip_line (); return false;}
char * cp = key;
while (* command > 32 && * command != '=') copy_char (& cp, & command);
* cp = '\0';
if (strcmp (key, boundary) == 0) {
command = strstr (command, "name=");
if (command == 0) return false;
while (* command > 32 && * command != '"') command++; command++;
cp = key;
while (* command > 32 && * command != '"') * cp++ = * command++;
* cp = '\0';
if (strstr (command, "filename=") == command + 3) {
strcpy (key_pending, key); strcat (key_pending, "_filename");
char * sub1 = parameter_pending;
char * sub2 = command + 13;
while (* sub2 > 0 && * sub2 != '"') * sub1++ = * sub2++; * sub1 = '\0';
skip_line ();
}
skip_line ();
skip_line ();
cp = area;
char * terminator = strstr (command, boundary);
while (terminator != 0 && command < terminator - 2) * cp++ = * command++;
skip_line ();
* cp = '\0';
return true;
}
if (boundary [0] != '\0' && strstr (key, boundary) == key) return false;
if (* command == '=') command++;
cp = area;
while (* command > 32 && * command != '&') copy_char (& cp, & command);
* cp = '\0';
if (* command == '&') command++;
return true;
}
开发者ID:HERCsMusicSystems,项目名称:dev,代码行数:41,代码来源:prolog_http.cpp
示例18: change_trap
void change_trap()
{
symbol s = get_name(1);
if (!s.is_null()) {
vunits x;
if (has_arg() && get_vunits(&x, 'v'))
topdiv->change_trap(s, x);
else
topdiv->remove_trap(s);
}
skip_line();
}
开发者ID:Distrotech,项目名称:groff,代码行数:12,代码来源:div.cpp
示例19: page_number
void page_number()
{
int n;
// the ps4html register is set if we are using -Tps
// to generate images for html
reg *r = (reg *)number_reg_dictionary.lookup("ps4html");
if (r == NULL)
if (has_arg() && get_integer(&n, topdiv->get_page_number()))
topdiv->set_next_page_number(n);
skip_line();
}
开发者ID:Distrotech,项目名称:groff,代码行数:12,代码来源:div.cpp
示例20: when_request
void when_request()
{
vunits n;
if (get_vunits(&n, 'v')) {
symbol s = get_name();
if (s.is_null())
topdiv->remove_trap_at(n);
else
topdiv->add_trap(s, n);
}
skip_line();
}
开发者ID:Distrotech,项目名称:groff,代码行数:12,代码来源:div.cpp
注:本文中的skip_line函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论