Lines Matching defs:mlist

67  * A mlist structure represents a command history.
69 struct mlist
71 struct mlist *next;
72 struct mlist *prev;
73 struct mlist *curr_mp;
81 struct mlist mlist_search =
85 struct mlist mlist_examine =
90 struct mlist mlist_shell =
109 static struct mlist *curr_mlist = NULL;
613 * Select an mlist structure to be the current command history.
615 public void set_mlist(void *mlist, int cmdflags)
618 curr_mlist = (struct mlist *) mlist;
621 /* Make sure the next up-arrow moves to the last string in the mlist. */
636 struct mlist *ml;
712 static void ml_link(struct mlist *mlist, struct mlist *ml)
714 ml->next = mlist;
715 ml->prev = mlist->prev;
716 mlist->prev->next = ml;
717 mlist->prev = ml;
723 static void ml_unlink(struct mlist *ml)
730 * Add a string to an mlist.
732 public void cmd_addhist(struct mlist *mlist, constant char *cmd, lbool modified)
735 struct mlist *ml;
745 struct mlist *next = NULL;
746 for (ml = mlist->next; ml->string != NULL; ml = next)
762 ml = mlist->prev;
763 if (ml == mlist || strcmp(ml->string, cmd) != 0)
769 ml = (struct mlist *) ecalloc(1, sizeof(struct mlist));
772 ml_link(mlist, ml);
778 mlist->curr_mp = ml->next;
1352 static int mlist_size(struct mlist *ml)
1423 static void read_cmdhist2(void (*action)(void*,struct mlist*,constant char*), void *uparam, int skip_search, int skip_shell)
1425 struct mlist *ml = NULL;
1488 static void read_cmdhist(void (*action)(void*,struct mlist*,constant char*), void *uparam, lbool skip_search, lbool skip_shell)
1496 static void addhist_init(void *uparam, struct mlist *ml, constant char *string)
1520 static void write_mlist_header(struct mlist *ml, FILE *f)
1531 * Write all modified entries in an mlist to the history file.
1533 static void write_mlist(struct mlist *ml, FILE *f)
1542 ml->modified = FALSE; /* entire mlist is now unmodified */
1560 struct mlist *mlist;
1566 * At the end of each mlist, append any new entries
1569 static void copy_hist(void *uparam, struct mlist *ml, constant char *string)
1573 if (ml != NULL && ml != ctx->mlist) {
1575 if (ctx->mlist)
1576 /* Append any new entries to the end of the current mlist. */
1577 write_mlist(ctx->mlist, ctx->fout);
1578 /* Write the header for the new mlist. */
1579 ctx->mlist = ml;
1580 write_mlist_header(ctx->mlist, ctx->fout);
1600 /* Copy mlist entry. */
1680 ctx.mlist = NULL;