Lines Matching full:cp
642 const char *cp; in parseline() local
659 cp = skipcomment(tline); in parseline()
661 if (*cp == '#') { in parseline()
664 cp = skipcomment(cp + 1); in parseline()
665 } else if (*cp != '\0') in parseline()
669 keyword = tline + (cp - tline); in parseline()
670 cp = skipsym(cp); in parseline()
671 kwlen = cp - keyword; in parseline()
673 if (strncmp(cp, "\\\r\n", 3) == 0 || in parseline()
674 strncmp(cp, "\\\n", 2) == 0) in parseline()
678 cp = skipcomment(cp); in parseline()
679 if ((cursym = findsym(cp)) < 0) in parseline()
691 cp = skipsym(cp); in parseline()
693 retval = ifeval(&cp); in parseline()
695 retval = ifeval(&cp) - LT_IF + LT_ELIF; in parseline()
704 cp = skipcomment(cp); in parseline()
705 if (*cp != '\0') { in parseline()
722 size_t len = cp - tline; in parseline()
726 cp += strlen(newline); in parseline()
734 while (*cp != '\0') in parseline()
735 cp = skipcomment(cp + 1); in parseline()
827 const char *cp; in eval_unary() local
833 cp = skipcomment(*cpp); in eval_unary()
834 if (*cp == '!') { in eval_unary()
836 cp++; in eval_unary()
837 lt = eval_unary(ops, valp, &cp); in eval_unary()
844 } else if (*cp == '(') { in eval_unary()
845 cp++; in eval_unary()
847 lt = eval_table(eval_ops, valp, &cp); in eval_unary()
850 cp = skipcomment(cp); in eval_unary()
851 if (*cp++ != ')') in eval_unary()
853 } else if (isdigit((unsigned char)*cp)) { in eval_unary()
855 *valp = strtol(cp, &ep, 0); in eval_unary()
856 if (ep == cp) in eval_unary()
859 cp = skipsym(cp); in eval_unary()
860 } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { in eval_unary()
861 cp = skipcomment(cp+7); in eval_unary()
863 if (*cp == '(') { in eval_unary()
864 cp = skipcomment(cp+1); in eval_unary()
869 sym = findsym(cp); in eval_unary()
876 cp = skipsym(cp); in eval_unary()
877 cp = skipcomment(cp); in eval_unary()
878 if (defparen && *cp++ != ')') in eval_unary()
881 } else if (!endsym(*cp)) { in eval_unary()
883 sym = findsym(cp); in eval_unary()
884 cp = skipsym(cp); in eval_unary()
887 cp = skipargs(cp); in eval_unary()
896 cp = skipargs(cp); in eval_unary()
904 *cpp = cp; in eval_unary()
916 const char *cp; in eval_table() local
921 cp = *cpp; in eval_table()
922 lt = ops->inner(ops+1, valp, &cp); in eval_table()
926 cp = skipcomment(cp); in eval_table()
928 if (strncmp(cp, op->str, strlen(op->str)) == 0) in eval_table()
932 cp += strlen(op->str); in eval_table()
934 rt = ops->inner(ops+1, &val, &cp); in eval_table()
940 *cpp = cp; in eval_table()
972 skipcomment(const char *cp) in skipcomment() argument
975 for (; isspace((unsigned char)*cp); cp++) in skipcomment()
976 if (*cp == '\n') in skipcomment()
978 return (cp); in skipcomment()
980 while (*cp != '\0') in skipcomment()
982 if (strncmp(cp, "\\\r\n", 3) == 0) in skipcomment()
983 cp += 3; in skipcomment()
984 else if (strncmp(cp, "\\\n", 2) == 0) in skipcomment()
985 cp += 2; in skipcomment()
988 if (strncmp(cp, "/\\\r\n", 4) == 0) { in skipcomment()
990 cp += 4; in skipcomment()
991 } else if (strncmp(cp, "/\\\n", 3) == 0) { in skipcomment()
993 cp += 3; in skipcomment()
994 } else if (strncmp(cp, "/*", 2) == 0) { in skipcomment()
996 cp += 2; in skipcomment()
997 } else if (strncmp(cp, "//", 2) == 0) { in skipcomment()
999 cp += 2; in skipcomment()
1000 } else if (strncmp(cp, "\'", 1) == 0) { in skipcomment()
1003 cp += 1; in skipcomment()
1004 } else if (strncmp(cp, "\"", 1) == 0) { in skipcomment()
1007 cp += 1; in skipcomment()
1008 } else if (strncmp(cp, "\n", 1) == 0) { in skipcomment()
1010 cp += 1; in skipcomment()
1011 } else if (strchr(" \r\t", *cp) != NULL) { in skipcomment()
1012 cp += 1; in skipcomment()
1014 return (cp); in skipcomment()
1017 if (strncmp(cp, "\n", 1) == 0) { in skipcomment()
1021 cp += 1; in skipcomment()
1025 if ((incomment == CHAR_LITERAL && cp[0] == '\'') || in skipcomment()
1026 (incomment == STRING_LITERAL && cp[0] == '\"')) { in skipcomment()
1028 cp += 1; in skipcomment()
1029 } else if (cp[0] == '\\') { in skipcomment()
1030 if (cp[1] == '\0') in skipcomment()
1031 cp += 1; in skipcomment()
1033 cp += 2; in skipcomment()
1034 } else if (strncmp(cp, "\n", 1) == 0) { in skipcomment()
1040 cp += 1; in skipcomment()
1043 if (strncmp(cp, "*\\\r\n", 4) == 0) { in skipcomment()
1045 cp += 4; in skipcomment()
1046 } else if (strncmp(cp, "*\\\n", 3) == 0) { in skipcomment()
1048 cp += 3; in skipcomment()
1049 } else if (strncmp(cp, "*/", 2) == 0) { in skipcomment()
1051 cp += 2; in skipcomment()
1053 cp += 1; in skipcomment()
1056 if (*cp == '*') { in skipcomment()
1058 cp += 1; in skipcomment()
1059 } else if (*cp == '/') { in skipcomment()
1061 cp += 1; in skipcomment()
1068 if (*cp == '/') { in skipcomment()
1070 cp += 1; in skipcomment()
1077 return (cp); in skipcomment()
1084 skipargs(const char *cp) in skipargs() argument
1086 const char *ocp = cp; in skipargs()
1088 cp = skipcomment(cp); in skipargs()
1089 if (*cp != '(') in skipargs()
1090 return (cp); in skipargs()
1092 if (*cp == '(') in skipargs()
1094 if (*cp == ')') in skipargs()
1096 cp = skipcomment(cp+1); in skipargs()
1097 } while (level != 0 && *cp != '\0'); in skipargs()
1099 return (cp); in skipargs()
1109 skipsym(const char *cp) in skipsym() argument
1111 while (!endsym(*cp)) in skipsym()
1112 ++cp; in skipsym()
1113 return (cp); in skipsym()
1123 const char *cp; in findsym() local
1126 cp = skipsym(str); in findsym()
1127 if (cp == str) in findsym()
1135 (int)(cp-str), str, in findsym()
1141 if (strlcmp(symname[symind], str, cp-str) == 0) { in findsym()