Lines Matching defs:tokst
2426 static TOK_STATE tokst;
2435 tokst.tokst_cmd_len = strlen(user_cmd_str);
2436 if ((len > 0) && (len < tokst.tokst_cmd_len))
2437 tokst.tokst_cmd_len = len;
2438 tokst.tokst_cmd_len++; /* Room for NULL termination */
2439 strbuf_ensure_size(&str, tokst.tokst_cmd_len);
2440 (void) strlcpy(str.buf, user_cmd_str, tokst.tokst_cmd_len);
2443 if ((tokst.tokst_cmd_len > 1) &&
2444 (str.buf[tokst.tokst_cmd_len - 2] == '\n')) {
2445 tokst.tokst_cmd_len--;
2446 str.buf[tokst.tokst_cmd_len - 1] = '\0';
2451 tokst.tokst_str_size = 0; /* Space needed for token strings */
2452 for (tokst.tokst_cnt = 0; gettok(&gettok_state) != 0;
2453 tokst.tokst_cnt++) {
2455 if (tokst.tokst_cnt >= tokst.tokst_bufsize) {
2456 n = (tokst.tokst_bufsize == 0) ?
2457 INITIAL_TOK_ALLOC : (tokst.tokst_bufsize * 2);
2458 tokst.tokst_buf = elfedit_realloc(
2459 MSG_INTL(MSG_ALLOC_TOKBUF), tokst.tokst_buf,
2460 n * sizeof (*tokst.tokst_buf));
2461 tokst.tokst_bufsize = n;
2463 tokst.tokst_str_size +=
2465 tokst.tokst_buf[tokst.tokst_cnt] = gettok_state.gtok_last_token;
2468 if (tokst.tokst_cnt > 0) {
2471 for (s = tokst.tokst_buf[0].tok_str; *s; s++)
2476 return (&tokst);
2489 TOK_STATE *tokst;
2501 tokst = tokenize_user_cmd(user_cmd_str, -1, 0);
2502 if (tokst->tokst_cnt == 0)
2506 cmd = elfedit_find_command(tokst->tokst_buf[0].tok_str, 1, &mod);
2521 n + (sizeof (char *) * (tokst->tokst_cnt - 1)) +
2522 tokst->tokst_cmd_len + tokst->tokst_str_size);
2524 ucmd->ucmd_argc = tokst->tokst_cnt - 1;
2528 (void) strncpy(ucmd->ucmd_orig_str, user_cmd_str, tokst->tokst_cmd_len);
2532 s = ucmd->ucmd_orig_str + tokst->tokst_cmd_len;
2533 for (n = 1; n < tokst->tokst_cnt; n++) {
2534 len = tokst->tokst_buf[n].tok_len + 1;
2536 (void) strncpy(s, tokst->tokst_buf[n].tok_str, len);
3128 TOK_STATE *tokst;
3154 tokst = tokenize_user_cmd(line, word_end, 1);
3155 if (tokst->tokst_cnt == 0)
3159 ndx = tokst->tokst_cnt - 1; /* Index of token to complete */
3162 cstate.ecpl_word_start = tokst->tokst_buf[ndx].tok_line_off;
3165 cstate.ecpl_token_str = tokst->tokst_buf[ndx].tok_str;
3166 cstate.ecpl_token_len = tokst->tokst_buf[ndx].tok_len;
3183 cmd = elfedit_find_command(tokst->tokst_buf[0].tok_str, 0, &mod);
3221 argv[i] = tokst->tokst_buf[i + 1].tok_str;