Lines Matching refs:loc
69 struct locus *loc,
75 struct locus *loc,
80 struct locus *loc,
84 static int parse_enum(struct protolib *plib, struct locus *loc,
155 parse_ident(struct locus *loc, char **str) in parse_ident() argument
160 report_error(loc->filename, loc->line_no, "bad identifier"); in parse_ident()
204 parse_int(struct locus *loc, char **str, long *ret) in parse_int() argument
209 report_error(loc->filename, loc->line_no, "bad number"); in parse_int()
220 check_nonnegative(struct locus *loc, long l) in check_nonnegative() argument
223 report_error(loc->filename, loc->line_no, in check_nonnegative()
231 check_int(struct locus *loc, long l) in check_int() argument
235 report_error(loc->filename, loc->line_no, in check_int()
243 parse_char(struct locus *loc, char **str, char expected) in parse_char() argument
246 report_error(loc->filename, loc->line_no, in parse_char()
255 static struct expr_node *parse_argnum(struct locus *loc,
259 parse_zero(struct locus *loc, char **str, int *ownp) in parse_zero() argument
265 struct expr_node *arg = parse_argnum(loc, str, &own, 0); in parse_zero()
268 if (parse_char(loc, str, ')') < 0) { in parse_zero()
305 parse_argnum(struct locus *loc, char **str, int *ownp, int zero) in parse_argnum() argument
313 if (parse_int(loc, str, &l) < 0 in parse_argnum()
314 || check_nonnegative(loc, l) < 0 in parse_argnum()
315 || check_int(loc, l) < 0) in parse_argnum()
327 char *const name = parse_ident(loc, str); in parse_argnum()
338 if (parse_int(loc, &num, &l) < 0 in parse_argnum()
339 || check_int(loc, l) < 0) in parse_argnum()
368 = parse_zero(loc, str, ownp); in parse_argnum()
376 report_error(loc->filename, loc->line_no, in parse_argnum()
416 parse_typedef(struct protolib *plib, struct locus *loc, char **str) in parse_typedef() argument
420 char *name = parse_ident(loc, str); in parse_typedef()
429 report_error(loc->filename, loc->line_no, in parse_typedef()
438 if (parse_char(loc, str, '=') < 0) in parse_typedef()
445 = parse_lens(plib, loc, str, NULL, 0, &own, &fwd); in parse_typedef()
464 report_error(loc->filename, loc->line_no, in parse_typedef()
485 parse_struct(struct protolib *plib, struct locus *loc, in parse_struct() argument
493 report_error(loc->filename, loc->line_no, in parse_struct()
506 if (parse_char(loc, str, '(') < 0) in parse_struct()
516 parse_char(loc, str, ')'); in parse_struct()
522 parse_char(loc, str, ','); in parse_struct()
527 = parse_lens(plib, loc, str, NULL, 0, &own, NULL); in parse_struct()
538 unshare_type_info(struct locus *loc, struct arg_type_info **infop, int *ownp) in unshare_type_info() argument
545 report_error(loc->filename, loc->line_no, in unshare_type_info()
556 parse_string(struct protolib *plib, struct locus *loc, in parse_string() argument
567 if (parse_int(loc, str, &l) < 0 in parse_string()
568 || check_int(loc, l) < 0) in parse_string()
594 length = parse_argnum(loc, str, &own_length, 1); in parse_string()
599 parse_char(loc, str, ']'); in parse_string()
606 info = parse_type(plib, loc, str, NULL, 0, ownp, NULL); in parse_string()
614 parse_char(loc, str, ')'); in parse_string()
647 if (unshare_type_info(loc, &info, ownp) < 0) in parse_string()
661 build_printf_pack(struct locus *loc, struct param **packp, size_t param_num) in build_printf_pack() argument
664 report_error(loc->filename, loc->line_no, in build_printf_pack()
669 report_error(loc->filename, loc->line_no, in build_printf_pack()
712 parse_alias(struct protolib *plib, struct locus *loc, in parse_alias() argument
723 return parse_string(plib, loc, str, retp, ownp); in parse_alias()
731 if (parse_string(plib, loc, str, retp, ownp) < 0) in parse_alias()
734 return build_printf_pack(loc, extra_param, param_num); in parse_alias()
738 return parse_enum(plib, loc, str, retp, ownp); in parse_alias()
748 parse_array(struct protolib *plib, struct locus *loc, in parse_array() argument
752 if (parse_char(loc, str, '(') < 0) in parse_array()
758 = parse_lens(plib, loc, str, NULL, 0, &own, NULL); in parse_array()
763 parse_char(loc, str, ','); in parse_array()
767 struct expr_node *length = parse_argnum(loc, str, &own_length, 0); in parse_array()
779 parse_char(loc, str, ')'); in parse_array()
788 parse_enum(struct protolib *plib, struct locus *loc, char **str, in parse_enum() argument
794 parse_char(loc, str, '['); in parse_enum()
796 *retp = parse_nonpointer_type(plib, loc, str, NULL, 0, ownp, 0); in parse_enum()
801 report_error(loc->filename, loc->line_no, in parse_enum()
814 if (parse_char(loc, str, ']') < 0) in parse_enum()
823 if (unshare_type_info(loc, retp, ownp) < 0) in parse_enum()
827 if (parse_char(loc, str, '(') < 0) in parse_enum()
832 report_error(loc->filename, loc->line_no, in parse_enum()
845 parse_char(loc, str, ')'); in parse_enum()
853 parse_char(loc, str, ','); in parse_enum()
856 char *key = parse_ident(loc, str); in parse_enum()
866 if (parse_int(loc, str, &last_val) < 0) in parse_enum()
886 parse_nonpointer_type(struct protolib *plib, struct locus *loc, in parse_nonpointer_type() argument
894 if (parse_alias(plib, loc, str, &type, in parse_nonpointer_type()
902 report_error(loc->filename, loc->line_no, in parse_nonpointer_type()
935 report_error(loc->filename, loc->line_no, in parse_nonpointer_type()
942 if (parse_array(plib, loc, str, info) < 0) { in parse_nonpointer_type()
949 if (parse_struct(plib, loc, str, info, forwardp) < 0) in parse_nonpointer_type()
983 parse_type(struct protolib *plib, struct locus *loc, char **str, in parse_type() argument
988 = parse_nonpointer_type(plib, loc, str, extra_param, in parse_type()
1002 report_error(loc->filename, loc->line_no, in parse_type()
1017 parse_lens(struct protolib *plib, struct locus *loc, in parse_lens() argument
1034 } else if (parse_char(loc, str, '(') < 0) { in parse_lens()
1035 report_error(loc->filename, loc->line_no, in parse_lens()
1043 info = parse_type(plib, loc, str, extra_param, param_num, in parse_lens()
1055 parse_char(loc, str, ')'); in parse_lens()
1060 if (lens != NULL && unshare_type_info(loc, &info, ownp) < 0) in parse_lens()
1095 struct locus *loc = data; in void_to_hidden_int() local
1097 report_warning(loc->filename, loc->line_no, in void_to_hidden_int()
1110 process_line(struct protolib *plib, struct locus *loc, char *buf) in process_line() argument
1115 debug(3, "Reading line %d of `%s'", loc->line_no, loc->filename); in process_line()
1123 parse_typedef(plib, loc, &str); in process_line()
1133 fun.return_info = parse_lens(plib, loc, &str, NULL, 0, &own, NULL); in process_line()
1136 debug(3, " Skipping line %d", loc->line_no); in process_line()
1153 report_error(loc->filename, loc->line_no, "syntax error"); in process_line()
1161 report_error(loc->filename, loc->line_no, in process_line()
1190 = parse_lens(plib, loc, &str, &extra_param, in process_line()
1193 report_error(loc->filename, loc->line_no, in process_line()
1212 report_error(loc->filename, loc->line_no, in process_line()
1236 report_warning(loc->filename, loc->line_no, in process_line()
1240 prototype_each_param(&fun, NULL, void_to_hidden_int, loc); in process_line()
1250 report_error(loc->filename, loc->line_no, in process_line()
1264 struct locus loc = { path, 0 }; in read_config_file() local
1268 loc.line_no++; in read_config_file()
1269 process_line(plib, &loc, line); in read_config_file()