Lines Matching +full:wait +full:- +full:free +full:- +full:us

1 /*-
34 * editor --
56 if (gp->scr_busy == NULL) in editor()
57 gp->scr_busy = vs_busy; in editor()
59 if (gp->scr_msg == NULL) in editor()
60 gp->scr_msg = vs_msg; in editor()
61 gp->catd = (nl_catd)-1; in editor()
64 TAILQ_INIT(gp->dq); in editor()
65 TAILQ_INIT(gp->hq); in editor()
66 SLIST_INIT(gp->ecq); in editor()
67 SLIST_INSERT_HEAD(gp->ecq, &gp->excmd, q); in editor()
68 gp->noprint = DEFAULT_NOPRINT; in editor()
71 TAILQ_INIT(gp->frefq); in editor()
72 TAILQ_INIT(gp->dcb_store.textq); in editor()
73 SLIST_INIT(gp->cutq); in editor()
74 SLIST_INIT(gp->seqq); in editor()
90 /* Convert old-style arguments into new-style ones. */ in editor()
112 * We should support multiple -c options. in editor()
114 if (gp->c_option != NULL) { in editor()
115 warnx("only one -c command may be specified."); in editor()
118 gp->c_option = optarg; in editor()
130 warnx("usage: -D requires s or w argument."); in editor()
150 warnx("only one of -r and -t may be specified."); in editor()
163 if ((gp->tracefp = fopen(optarg, "w")) == NULL) { in editor()
167 (void)fprintf(gp->tracefp, in editor()
173 warnx("only one of -r and -t may be specified."); in editor()
192 (void)gp->scr_usage(); in editor()
195 argc -= optind; in editor()
199 * -s option is only meaningful to ex. in editor()
201 * If not reading from a terminal, it's like -s was specified. in editor()
204 warnx("-s option is only applicable to ex."); in editor()
221 TAILQ_INSERT_HEAD(gp->dq, sp, q); in editor()
225 TAILQ_INSERT_HEAD(gp->dq, sp, q); in editor()
231 if (lflag) { /* Command-line options. */ in editor()
239 *oargp = -1; /* Options initialization. */ in editor()
262 sp->rows = O_VAL(sp, O_LINES); /* Make ex formatting work. */ in editor()
263 sp->cols = O_VAL(sp, O_COLUMNS); in editor()
276 * List recovery files if -r specified without file arguments. in editor()
297 sp->defscroll = (O_VAL(sp, O_WINDOW) + 1) / 2; in editor()
300 * If we don't have a command-line option, switch into the right in editor()
302 * so that any tags file file-already-locked messages are in the in editor()
306 * If we have a command-line option, the error message can end in editor()
310 if (gp->c_option == NULL) { in editor()
324 * files if -r specified. If the tag option or ex startup commands in editor()
328 if (sp->frp != NULL) { in editor()
329 /* Cheat -- we know we have an extra argv slot. */ in editor()
330 *--argv = strdup(sp->frp->name); in editor()
336 sp->argv = sp->cargv = argv; in editor()
344 * created a file, create one. If no command-line files were given, in editor()
347 if (sp->frp == NULL) { in editor()
348 if (sp->argv == NULL) { in editor()
352 if ((frp = file_add(sp, sp->argv[0])) == NULL) in editor()
371 * Check to see if we need to wait for ex. If SC_SCR_EX is set, ex in editor()
373 * wait for a single character from the user, but we can't because in editor()
376 * us to lose the messages we're pausing to make sure the user read. in editor()
377 * So, wait for a complete line. in editor()
389 (void)gp->scr_bell(sp); in editor()
416 * v_end --
428 if (gp->ccl_sp != NULL) { in v_end()
429 (void)file_end(gp->ccl_sp, NULL, 1); in v_end()
430 (void)screen_end(gp->ccl_sp); in v_end()
432 while ((sp = TAILQ_FIRST(gp->dq)) != NULL) in v_end()
434 while ((sp = TAILQ_FIRST(gp->hq)) != NULL) in v_end()
439 /* Free FREF's. */ in v_end()
440 while ((frp = TAILQ_FIRST(gp->frefq)) != NULL) { in v_end()
441 TAILQ_REMOVE(gp->frefq, frp, q); in v_end()
442 free(frp->name); in v_end()
443 free(frp->tname); in v_end()
444 free(frp); in v_end()
448 /* Free key input queue. */ in v_end()
449 free(gp->i_event); in v_end()
451 /* Free cut buffers. */ in v_end()
454 /* Free map sequences. */ in v_end()
457 /* Free default buffer storage. */ in v_end()
458 (void)text_lfree(gp->dcb_store.textq); in v_end()
470 * certainly the message about the event that killed us (although in v_end()
474 while ((mp = SLIST_FIRST(gp->msgq)) != NULL) { in v_end()
476 mp->mtype == M_ERR ? "ex/vi: " : "", (int)mp->len, mp->buf); in v_end()
477 SLIST_REMOVE_HEAD(gp->msgq, q); in v_end()
479 free(mp->buf); in v_end()
480 free(mp); in v_end()
485 /* Free any temporary space. */ in v_end()
486 free(gp->tmp_bp); in v_end()
490 if (gp->tracefp != NULL) in v_end()
491 (void)fclose(gp->tracefp); in v_end()
497 * v_obsolete --
510 * Change "+" into "-c$". in v_obsolete()
511 * Change "+<anything else>" into "-c<anything else>". in v_obsolete()
512 * Change "-" into "-s" in v_obsolete()
516 * Stop if we find "--" as an argument, the user may want to edit in v_obsolete()
519 while (*++argv && strcmp(argv[0], "--")) in v_obsolete()
522 argv[0] = strdup("-c$"); in v_obsolete()
531 argv[0][0] = '-'; in v_obsolete()
535 } else if (argv[0][0] == '-') { in v_obsolete()
537 argv[0] = strdup("-s"); in v_obsolete()