Lines Matching full:pos
234 void srcpos_update(struct srcpos *pos, const char *text, int len) in srcpos_update() argument
238 pos->file = current_srcfile; in srcpos_update()
240 pos->first_line = current_srcfile->lineno; in srcpos_update()
241 pos->first_column = current_srcfile->colno; in srcpos_update()
251 pos->last_line = current_srcfile->lineno; in srcpos_update()
252 pos->last_column = current_srcfile->colno; in srcpos_update()
256 srcpos_copy(struct srcpos *pos) in srcpos_copy() argument
261 if (!pos) in srcpos_copy()
265 assert(pos->next == NULL); in srcpos_copy()
266 memcpy(pos_new, pos, sizeof(struct srcpos)); in srcpos_copy()
270 memcpy(srcfile_state, pos->file, sizeof(struct srcfile_state)); in srcpos_copy()
276 struct srcpos *srcpos_extend(struct srcpos *pos, struct srcpos *newtail) in srcpos_extend() argument
280 if (!pos) in srcpos_extend()
283 for (p = pos; p->next != NULL; p = p->next); in srcpos_extend()
285 return pos; in srcpos_extend()
289 srcpos_string(struct srcpos *pos) in srcpos_string() argument
294 if (pos->file && pos->file->name) in srcpos_string()
295 fname = pos->file->name; in srcpos_string()
298 if (pos->first_line != pos->last_line) in srcpos_string()
300 pos->first_line, pos->first_column, in srcpos_string()
301 pos->last_line, pos->last_column); in srcpos_string()
302 else if (pos->first_column != pos->last_column) in srcpos_string()
304 pos->first_line, pos->first_column, in srcpos_string()
305 pos->last_column); in srcpos_string()
308 pos->first_line, pos->first_column); in srcpos_string()
314 srcpos_string_comment(struct srcpos *pos, bool first_line, int level) in srcpos_string_comment() argument
319 if (!pos) { in srcpos_string_comment()
328 if (!pos->file) in srcpos_string_comment()
330 else if (!pos->file->name) in srcpos_string_comment()
333 fname = pos->file->name; in srcpos_string_comment()
335 fresh_fname = shorten_to_initial_path(pos->file->name); in srcpos_string_comment()
339 fname = pos->file->name; in srcpos_string_comment()
344 pos->first_line, pos->first_column, in srcpos_string_comment()
345 pos->last_line, pos->last_column); in srcpos_string_comment()
348 first_line ? pos->first_line : pos->last_line); in srcpos_string_comment()
353 if (pos->next != NULL) { in srcpos_string_comment()
354 rest = srcpos_string_comment(pos->next, first_line, level); in srcpos_string_comment()
365 char *srcpos_string_first(struct srcpos *pos, int level) in srcpos_string_first() argument
367 return srcpos_string_comment(pos, true, level); in srcpos_string_first()
370 char *srcpos_string_last(struct srcpos *pos, int level) in srcpos_string_last() argument
372 return srcpos_string_comment(pos, false, level); in srcpos_string_last()
375 void srcpos_verror(struct srcpos *pos, const char *prefix, in srcpos_verror() argument
380 srcstr = srcpos_string(pos); in srcpos_verror()
389 void srcpos_error(struct srcpos *pos, const char *prefix, in srcpos_error() argument
395 srcpos_verror(pos, prefix, fmt, va); in srcpos_error()