Lines Matching defs:line

208  * undo command. It records a copy of the input line from before
209 * the command-mode action which edited the input line.
212 char *line; /* A historical copy of the input line */
214 /* line[] when the line was modified. */
215 int ntotal; /* The number of characters in line[] */
216 int saved; /* True once a line has been saved after the */
226 /* change to the line. */
367 GlHistory *glh; /* The line-history buffer */
393 size_t linelen; /* The max number of characters per line */
394 char *line; /* A line-input buffer of allocated size */
397 char *cutbuf; /* A cut-buffer of the same size as line[] */
417 int ntotal; /* The number of characters in gl->line[] */
418 int buff_curpos; /* The cursor position within gl->line[] */
421 /* display the current input line. */
427 /* the current contents of gl->line[] */
428 int displayed; /* True if an input line is currently displayed */
429 int redisplay; /* If true, the input line will be redrawn */
435 /* is next called, to resume line editing. */
443 /* line in the history buffer for potential */
445 int preload_history; /* If true, preload the above history line when */
465 const char *bol; /* Move cursor to beginning of line */
467 /* the end of the line. */
502 int echo; /* True to display the line as it is being */
504 /* displayed, and the line will not be */
736 * Read a line from the user in raw mode.
757 * Prepare to edit a new line.
763 * Reset all line input parameters for a new input line.
839 * Add a character to the line buffer at the current cursor position,
845 * Insert/append a string to the line buffer and terminal at the current
851 * Record a new character in the input-line buffer.
856 * Record a string in the input-line buffer.
861 * Make way to insert a string in the input-line buffer.
866 * Remove characters from the input-line buffer, and move any characters
872 * Terminate the input-line buffer after a specified number of characters.
877 * Delete the displayed part of the input line that follows the current
883 * Accomodate changes to the contents of the input line buffer
909 * Set the position of the cursor both in the line input buffer and on the
964 * Parse a single configuration command line.
1042 * read) character in the input line, or the character that precedes
1064 * current line and cursor position for potential restoration later
1076 * character in the input line. Also switch to insert mode if requested
1084 * a specified (or read) character in the input line, into the cut buffer.
1089 * Return the line index of the parenthesis that either matches the one under
1125 * Prepare to return the current input line to the caller of gl_get_line().
1130 * Arrange for the input line to be redisplayed when the current contents
1136 * Erase the displayed representation of the input line, without
1142 * This function is called whenever the input line has been erased.
1147 * Arrange for the current input line to be discarded.
1165 * Redraw the current input line to account for a change in the terminal
1194 static int _gl_append_history(GetLine *gl, const char *line);
1210 * Set the maximum length of a line in a user's tecla configuration
1352 {"beginning-of-line", gl_beginning_of_line},
1353 {"end-of-line", gl_end_of_line},
1354 {"delete-line", gl_delete_line},
1355 {"kill-line", gl_kill_line},
1406 {"backward-kill-line", gl_backward_kill_line},
1410 {"vi-change-rest-of-line", gl_vi_change_rest_of_line},
1411 {"vi-change-line", gl_vi_change_line},
1433 {"copy-rest-of-line", gl_copy_rest_of_line},
1434 {"copy-line", gl_copy_line},
1467 {"^A", "beginning-of-line"},
1468 {"^E", "end-of-line"},
1469 {"^U", "delete-line"},
1470 {"^K", "kill-line"},
1552 {"^U", "backward-kill-line"},
1561 {"M-$", "end-of-line"},
1569 {"M-^", "beginning-of-line"},
1590 {"M-C", "vi-change-rest-of-line"},
1593 {"M-cc", "vi-change-line"},
1611 {"M-c$", "vi-change-rest-of-line"},
1619 {"M-dd", "delete-line"},
1632 {"M-d^", "backward-kill-line"},
1633 {"M-d0", "backward-kill-line"},
1634 {"M-d$", "kill-line"},
1635 {"M-D", "kill-line"},
1660 {"M-S", "vi-change-line"},
1687 {"M-y$", "copy-rest-of-line"},
1688 {"M-yy", "copy-line"},
1689 {"M-Y", "copy-line"},
1718 * linelen size_t The maximum line length to allow for.
1775 gl->line = NULL;
1816 gl->vi.undo.line = NULL;
1918 * Allocate a line buffer, leaving 2 extra characters for the terminating
1921 gl->line = (char *) malloc(linelen + 2);
1922 if(!gl->line) {
1927 * Start with an empty input line.
1950 gl->vi.undo.line = (char *) malloc(linelen + 2);
1951 if(!gl->vi.undo.line) {
1955 gl->vi.undo.line[0] = '\0';
2066 if(gl->line)
2067 free(gl->line);
2077 if(gl->vi.undo.line)
2078 free(gl->vi.undo.line);
2145 * Read a line from the user.
2149 * prompt char * The prompt to prefix the line with.
2150 * start_line char * The initial contents of the input line, or NULL
2154 * should initially be positioned within the line.
2156 * of the line, send -1.
2158 * return char * An internal buffer containing the input line, or
2159 * NULL at the end of input. If the line fitted in
2163 * of the line should be retrieved via further calls
2183 * Perform the command-line editing task.
2204 * line until proven otherwise.
2232 * Attempt to read the line. This will require more than one attempt if
2238 * Read a line from a non-interactive stream?
2296 return gl->line;
2297 case GLR_BLOCKED: /* These events abort the current input line, */
2299 case GLR_TIMEOUT: /* temporarily pause line editing when in */
2304 case GLR_ERROR: /* Unrecoverable errors abort the input line, */
2317 * prompt char * The prompt to prefix the line with, or NULL if
2388 * input line.
2392 * Attempt to read the line. This will require more than one attempt if
2398 * Read a line from a non-interactive stream?
2462 * transaction, just like reading a completed input line, so prepare
2463 * for the next input line or character.
2761 * Read a new input line from the user.
2765 * prompt char * The prompt to prefix the line with, or NULL to
2767 * line.
2768 * start_line char * The initial contents of the input line, or NULL
2772 * should initially be positioned within the line.
2774 * of the line, send -1.
2789 * Are we starting a new line?
2793 * Delete any incompletely enterred line.
2798 * Display the new line to be edited.
2814 * to be added to the line.
2825 * Has the line been completed?
2832 * whether a signal was caught that requested that the current line
2855 * prompt char * The prompt to prefix the line with.
2873 * Delete any incompletely entered line.
2878 * Reset the line input parameters and display the prompt, if any.
2918 * line to be returned? If so return a newline character.
2927 * Start a new line.
2942 * Add a character to the line buffer at the current cursor position,
2964 * If we are in insert mode, or at the end of the line,
2972 * Are we adding characters to the line (ie. inserting or appending)?
2986 * Redraw the line from the cursor position to the end of the line,
2989 if(gl_print_string(gl, gl->line + buff_curpos, '\0') ||
2999 int old_width = gl_displayed_char_width(gl, gl->line[buff_curpos],
3007 * redraw the terminal string to the end of the line, then
3012 if(gl_print_string(gl, gl->line + buff_curpos, '\0'))
3027 * inserting new characters, and thus extending the line.
3031 * Redraw the line from the cursor position to the end of the line,
3034 if(gl_print_string(gl, gl->line + buff_curpos, '\0') ||
3051 if(gl_print_char(gl, c, gl->line[gl->buff_curpos]))
3059 * Insert/append a string to the line buffer and terminal at the current
3071 int buff_slen; /* The length of the string being added to line[] */
3104 * Write the modified part of the line to the terminal, then move
3107 if(gl_print_string(gl, gl->line + buff_curpos, '\0') ||
3129 * or to have gl_get_line() return the current line
3427 * Start a fresh line?
3472 * Redraw the line?
3759 char c; /* The character to be added to the line */
3767 * Add the character to the line 'count' times.
3965 /* the cursor wrt the start of the input line. */
3967 /* the cursor wrt the start of the input line. */
3969 * Do nothing if the input line isn't currently displayed. In this
3970 * case, the cursor will be moved to the right place when the line
3988 * Move down to the next line.
3995 * Move up to the previous line.
4002 * Move to the right within the target line?
4023 * Move to the left within the target line?
4061 * start of the next line until one more character
4066 * If at the end of the input line send '\0' or a
4068 * pass the next character in the input line
4119 * of the input line.
4124 * If the new character ended exactly at the end of a line,
4125 * most terminals won't move the cursor onto the next line until we
4126 * have written a character on the next line, so append an extra
4148 * start of the next line until one more character
4153 * If at the end of the input line send '\0' or a
4155 * pass the next character in the input line
4216 * the line.
4225 * the line.
4234 * current line.
4239 * If in vi command mode, preserve the current line for potential
4244 * Copy the contents of the line to the cut buffer.
4246 strlcpy(gl->cutbuf, gl->line, gl->linelen);
4266 * current cursor position and the end of the line.
4271 * If in vi command mode, preserve the current line for potential
4276 * Copy the part of the line that is about to be deleted to the cut buffer.
4278 strlcpy(gl->cutbuf, gl->line + gl->buff_curpos, gl->linelen);
4280 * Terminate the buffered line at the current cursor position.
4284 * Clear the part of the line that follows the cursor.
4297 * start of the line and the current cursor position.
4308 * Move the cursor to the start of the line, or in vi input mode,
4309 * the start of the sub-line at which insertion started, and delete
4356 * If in vi command mode, preserve the current line for potential
4370 memcpy(gl->cutbuf, gl->line + gl->buff_curpos, nc);
4393 gl_buffer_string(gl, gl->vi.undo.line + gl->buff_curpos, nrestore,
4398 * implies that we are deleting from the end of the line, so we need
4399 * to terminate the line either where the undo buffer ran out, or if
4409 * Copy the remaining part of the line back over the deleted characters.
4416 if(gl_print_string(gl, gl->line + gl->buff_curpos, '\0'))
4454 * If in vi command mode, preserve the current line for potential
4497 * If in vi command mode, preserve the current line for potential
4526 * If in vi command mode, preserve the current line for potential
4544 * instance of a specified or queried character, in the input line.
4574 * If in vi command mode, preserve the current line for potential
4579 * Allow the cursor to be at the end of the line if this is a change
4671 * If in vi command mode, preserve the current line for potential
4679 char *cptr = gl->line + gl->buff_curpos;
4707 * If in vi command mode, preserve the current line for potential
4715 char *cptr = gl->line + gl->buff_curpos;
4739 char *cptr; /* &gl->line[gl->buff_curpos] */
4747 * If in vi command mode, preserve the current line for potential
4763 for(cptr = gl->line + pos ; pos<gl->ntotal && !gl_is_word_char((int) *cptr);
4782 gl_buffer_char(gl, toupper((int) *cptr), cptr - gl->line);
4785 gl_buffer_char(gl, tolower((int) *cptr), cptr - gl->line);
4804 * This is an action function which redraws the current line.
4813 * Do nothing if there is no line to be redisplayed.
4818 * Erase the current input line.
4828 * Render the part of the line that the user has typed in so far.
4830 if(gl_print_string(gl, gl->line, '\0'))
4842 * Flush the redisplayed line to the terminal.
4849 * input line from the home position.
4860 * The input line is no longer displayed.
4864 * Arrange for the input line to be redisplayed.
4879 * If we are at the beginning or end of the line, there aren't two
4885 * If in vi command mode, preserve the current line for potential
4892 from[0] = gl->line[gl->buff_curpos - 1];
4893 from[1] = gl->line[gl->buff_curpos];
4895 swap[0] = gl->line[gl->buff_curpos];
4896 swap[1] = gl->line[gl->buff_curpos - 1];
4918 gl_print_char(gl, swap[1], gl->line[gl->buff_curpos+2]))
4926 if(gl_print_string(gl, gl->line + gl->buff_curpos, '\0') ||
4954 * line.
4974 * If in vi command mode, preserve the current line for potential
4979 * Limit the mark to be within the line.
5017 * Get the position of the mark, limiting it to lie within the line.
5029 * Get the line indexes of the first and last characters in the region.
5041 memcpy(gl->cutbuf, gl->line + ca, cb + 1 - ca);
5063 * If in vi command mode, preserve the current line for potential
5101 * If in vi command mode, preserve the current line for potential
5160 * current input line accordingly.
5176 * Update gl and the displayed line to fit the new dimensions.
5182 * Redraw the current input line to account for a change in the terminal
5206 * If we are currently editing a line, erase it.
5216 * Arrange for the input line to be redrawn before the next character
5225 * This is the action function that recalls the previous line in the
5246 if(_glh_search_prefix(gl->glh, gl->line, 0)) {
5251 * Recall the count'th next older line in the history list. If the first one
5253 * and update the line state.
5255 if(_glh_find_backwards(gl->glh, gl->line, gl->linelen+1) == NULL)
5257 while(--count && _glh_find_backwards(gl->glh, gl->line, gl->linelen+1))
5260 * Accomodate the new contents of gl->line[].
5264 * Arrange to have the cursor placed at the end of the new line.
5268 * Erase and display the new line.
5275 * This is the action function that recalls the next line in the
5291 * session from a previous entered line if possible.
5294 _glh_recall_line(gl->glh, gl->preload_id, gl->line, gl->linelen+1);
5300 if(_glh_search_prefix(gl->glh, gl->line, 0)) {
5305 * Recall the count'th next newer line in the history list. If the first one
5307 * and update the line state.
5309 if(_glh_find_forwards(gl->glh, gl->line, gl->linelen+1) == NULL)
5311 while(--count && _glh_find_forwards(gl->glh, gl->line, gl->linelen+1))
5315 * Accomodate the new contents of gl->line[].
5319 * Arrange to have the cursor placed at the end of the new line.
5323 * Erase and display the new line.
5330 * This is the action function that recalls the previous line in the
5358 _glh_search_prefix(gl->glh, gl->line, gl->buff_curpos +
5364 * Search backwards for a match to the part of the line which precedes the
5367 if(_glh_find_backwards(gl->glh, gl->line, gl->linelen+1) == NULL)
5370 * Accomodate the new contents of gl->line[].
5374 * Arrange to have the cursor placed at the end of the new line.
5378 * Erase and display the new line.
5385 * This is the action function that recalls the previous line in the
5395 * This is the action function that recalls the next line in the
5420 _glh_search_prefix(gl->glh, gl->line, gl->buff_curpos +
5426 * Search forwards for the next matching line.
5428 if(_glh_find_forwards(gl->glh, gl->line, gl->linelen+1) == NULL)
5431 * Accomodate the new contents of gl->line[].
5435 * Arrange for the cursor to be placed at the end of the new line.
5439 * Erase and display the new line.
5446 * This is the action function that recalls the next line in the
5478 /* total length of the line. */
5489 * complete at the end of the line).
5500 matches = cpl_complete_word(gl->cpl, gl->line, gl->buff_curpos, cb->data,
5512 * If there any ambiguous matches, report them, starting on a new line.
5544 * Will there be space for the expansion in the line buffer?
5565 * If we don't have to redisplay the whole line, redisplay the part
5566 * of the line which follows the original cursor position, and place
5571 gl_print_string(gl, gl->line + buff_pos, '\0') ||
5577 "Insufficient room in line for file completion.",
5585 * have been suspended, make sure that we are back in raw line editing
5602 /* gl->line[]. */
5612 * complete at the end of the line).
5619 start_path = _pu_start_of_path(gl->line, gl->buff_curpos);
5625 pathlen = gl->buff_curpos - (start_path - gl->line);
5631 * If there was an error, report the error on a new line.
5641 * If in vi command mode, preserve the current line for potential use by
5669 * Will there be space for the expansion in the line buffer?
5672 return gl_print_info(gl, "Insufficient room in line for file expansion.",
5676 * Do we need to move the part of the line that followed the unexpanded
5689 for(i=0,j=start_path - gl->line; i<result->nfile; i++) {
5703 * Redisplay the part of the line which follows the start of
5706 if(gl_place_cursor(gl, start_path - gl->line) ||
5713 return gl_place_cursor(gl, (start_path - gl->line) + length);
5726 /* gl->line[]. */
5732 start_path = _pu_start_of_path(gl->line, gl->buff_curpos);
5738 pathlen = gl->buff_curpos - (start_path - gl->line);
5784 * gl GetLine * The resource object of the command-line input
5791 * to be completed from the input line, and
5829 * gl GetLine * The resource object of the command-line input
6008 * gl GetLine * The resource object of the command-line input
6061 * a line it deletes the character which follows the cursor. When invoked
6062 * at the end of the line it lists possible file completions, and when
6063 * invoked on an empty line it causes gl_get_line() to return EOF. This
6069 * If we have an empty line arrange to return EOF.
6075 * If we are at the end of the line list possible completions.
6080 * Within the line delete the character that follows the cursor.
6084 * If in vi command mode, first preserve the current line for potential use
6097 * invoked within a line it lists possible file completions, and when
6098 * invoked on an empty line it causes gl_get_line() to return EOF. This
6104 * If we have an empty line arrange to return EOF.
6133 CplMatches *matches = cpl_complete_word(gl->cpl, gl->line, gl->buff_curpos,
6150 * have been suspended, make sure that we are back in raw line editing
6267 int lineno = 1; /* The line number being processed */
6323 int lineno = 1; /* The line number being processed */
6351 * Parse the next line of a getline configuration file.
6364 * lineno int * The line number being processed is to be
6373 char buffer[GL_CONF_BUFLEN+1]; /* The input line buffer */
6384 * Comments extend to the end of the line.
6400 * Read the rest of the line, stopping early if a comment is seen, or
6421 * If we hit the end of the line, or the start of a comment, exit the loop.
6523 * out an error message about the contents of the line, prefixed by the
6524 * name of the origin of the line and its line number.
6530 * lineno int The line number at which the error occurred.
6541 * Convert the line number into a string.
6574 * The current line is first discarded.
6579 /* gl->line[]. */
6585 start_path = _pu_start_of_path(gl->line, gl->buff_curpos);
6591 pathlen = gl->buff_curpos - (start_path - gl->line);
6597 * If there was an error, report the error on a new line.
6671 * This is the action function that recalls the oldest line in the
6690 * Recall the next oldest line in the history list.
6692 if(_glh_oldest_line(gl->glh, gl->line, gl->linelen+1) == NULL)
6695 * Accomodate the new contents of gl->line[].
6699 * Arrange to have the cursor placed at the end of the new line.
6703 * Erase and display the new line.
6711 * recalls the line that was being edited when the session started. If
6730 * Recall the next oldest line in the history list.
6732 if(_glh_current_line(gl->glh, gl->line, gl->linelen+1) == NULL)
6735 * Accomodate the new contents of gl->line[].
6739 * Arrange to have the cursor placed at the end of the new line.
6743 * Erase and display the new line.
6762 * In vi command mode, a lone '0' means goto-start-of-line.
6791 * gl_get_input_line() that the line is now complete.
6795 GlhLineID id; /* The last history line recalled while entering this line */
6797 * Flag the line as ended.
6812 * gl_get_input_line() that the line is now complete, and records the
6813 * ID of the next history line in gl->preload_id so that the next call
6814 * to gl_get_input_line() will preload the line with that history line.
6853 default: /* Abort the line if an error occurs */
6868 * Get the line-editor resource object.
6990 * If in vi command mode, preserve the current line for potential
7009 * If in vi command mode, preserve the current line for potential
7034 * If in vi command mode, preserve the current line for potential
7046 char *cptr = gl->line + gl->buff_curpos++;
7051 gl_buffer_char(gl, toupper((int) *cptr), cptr - gl->line);
7053 gl_buffer_char(gl, tolower((int) *cptr), cptr - gl->line);
7070 * moves the cursor to the start of the line, then switches to insert mode.
7082 * moves the cursor to the end of the line, then switches to insert mode
7083 * to allow text to be appended to the line.
7142 * If in vi command mode, preserve the current line for potential
7166 * current cursor position and the end of the line.
7177 * start of the line and the current cursor position.
7186 * current line and switches to insert mode.
7195 * line, copy 'count' characters to the cut buffer.
7209 memcpy(gl->cutbuf, gl->line + gl->buff_curpos, count);
7216 * backwards towards the start of the line, copy 'count' characters to
7232 memcpy(gl->cutbuf, gl->line + gl->buff_curpos, count);
7267 * Starting from the cursor position copy the rest of the line into the
7275 memcpy(gl->cutbuf, gl->line + gl->buff_curpos, gl->ntotal - gl->buff_curpos);
7281 * Copy from the beginning of the line to the cursor position into the
7289 memcpy(gl->cutbuf, gl->line, gl->buff_curpos);
7296 * Copy the entire line into the cut buffer.
7303 memcpy(gl->cutbuf, gl->line, gl->ntotal);
7348 * read) character in the input line, or the character that precedes
7362 * return int The index of the character in gl->line[], or
7367 int pos; /* The index reached in searching the input line */
7407 for( ; pos<gl->ntotal && c!=gl->line[pos]; pos++)
7431 for( ; pos>=gl->insert_curpos && c!=gl->line[pos]; pos--)
7481 * the line if there were less than 'count' words.
7500 * If we are at the end of the line, return the index of the last
7501 * real character on the line. Note that this will be -1 if the line
7507 * Search 'n' times, unless the end of the input line is reached first.
7513 for( ; bufpos<gl->ntotal && !gl_is_word_char((int)gl->line[bufpos]);
7519 for( ; bufpos<gl->ntotal && gl_is_word_char((int)gl->line[bufpos]);
7532 * the line if there were less than 'count' words.
7549 * Search 'n' times, unless the end of the input line is reached first.
7555 for( ; bufpos<gl->ntotal && gl_is_word_char((int)gl->line[bufpos]);
7561 for( ; bufpos<gl->ntotal && !gl_is_word_char((int)gl->line[bufpos]);
7571 * of the line if there were less than 'count' words.
7588 * Search 'n' times, unless the beginning of the input line (or vi insertion
7598 !gl_is_word_char((int)gl->line[bufpos]))
7604 gl_is_word_char((int)gl->line[bufpos]))
7634 memcpy(gl->cutbuf, gl->line + gl->buff_curpos, n);
7657 memcpy(gl->cutbuf, gl->line + next, n);
7664 * a specified character in the input line, into the cut buffer.
7695 memcpy(gl->cutbuf, gl->line + gl->buff_curpos, n);
7698 memcpy(gl->cutbuf, gl->line + pos, n);
7766 * Set the position of the cursor in the line input buffer and the
7780 * line.
7794 gl_displayed_string_width(gl, gl->line, buff_curpos, gl->prompt_len));
7798 * In vi command mode, this function saves the current line to the
7811 strlcpy(gl->vi.undo.line, gl->line, gl->linelen);
7826 * In vi mode, restore the line to the way it was before the last command
7827 * mode operation, storing the current line in the buffer so that the
7835 char *undo_ptr = gl->vi.undo.line;
7836 char *line_ptr = gl->line;
7839 * line.
7861 * Accomodate the new contents of gl->line[].
7880 * Display the restored line.
8064 * Make sure that the current line has been saved.
8074 * Using the current line which is saved in the undo buffer, plus
8077 * line.
8080 if(gl_add_char_to_line(gl, gl->vi.undo.line[i]))
8117 char c = gl->line[gl->buff_curpos];
8126 if(gl->line[i] == c)
8128 else if(gl->line[i] == match && --matches_needed==0)
8139 if(gl->line[i] == c)
8141 else if(gl->line[i] == match && --matches_needed==0)
8150 if(strchr(c_paren, gl->line[i]) != NULL)
8196 * input line buffer, and watch for the end of the line.
8280 * Mark the current line as not yet preserved for use by the vi undo command.
8332 * the start of any keysequence, so add it to the line in accordance
8526 * be recorded on a line started with this
8695 * gl GetLine * The resource object of the command-line input
8866 * gl GetLine * The resource object of the command-line input
9054 * Just in case the above event handlers asked for the input line to
9196 * 0. Whenever a new line is appended to the history list, the current
9262 * line in the history buffer.
9264 * the line belongs to.
9266 * %H - The history line itself.
9552 * Lookup a history line by its sequential number of entry in the
9557 * id unsigned long The identification number of the line to
9558 * be returned, where 0 denotes the first line
9560 * each subsequently added line has a number
9565 * line GlHistoryLine * A pointer to the variable in which to
9566 * return the details of the line.
9568 * return int 0 - The line is no longer in the history
9569 * list, and *line has not been changed.
9570 * 1 - The requested line can be found in
9571 * *line. Note that line->line is part
9578 int gl_lookup_history(GetLine *gl, unsigned long id, GlHistoryLine *line)
9595 status = _glh_lookup_history(gl->glh, (GlhLineID) id, &line->line,
9596 &line->group, &line->timestamp);
9701 * Start a new line.
9711 * Arrange for the input line to be redisplayed.
9720 * input line is not archived in the history list.
9781 * put the cursor at the beginning of the current terminal line.
9786 * Mark the line as partially displayed.
10251 * This function is called when an input line has been completed. It
10252 * appends the specified newline character, terminates the line,
10253 * records the line in the history buffer if appropriate, and positions
10254 * the terminal cursor at the start of the next line.
10259 * of the line.
10268 * the line, and add it to the input line buffer.
10275 * Otherwise just append a newline character to the input line buffer.
10281 * Add the line to the history buffer if it was entered with a
10285 (void) _gl_append_history(gl, gl->line);
10287 * Except when depending on the system-provided line editing, start a new
10288 * line after the end of the line that has just been entered.
10301 * The next call to gl_get_line() will write the prompt for a new line
10345 * Prepare to edit a new line.
10349 * prompt char * The prompt to prefix the line with, or NULL to
10351 * line.
10352 * start_line char * The initial contents of the input line, or NULL
10356 * should initially be positioned within the line.
10358 * of the line, send -1.
10367 * Reset the properties of the line.
10383 * If the previous line was entered via the repeat-history action,
10384 * preload the specified history line.
10389 if(_glh_recall_line(gl->glh, gl->preload_id, gl->line, gl->linelen+1)) {
10398 * Present a specified initial line?
10401 char *cptr; /* A pointer into gl->line[] */
10403 * Measure the length of the starting line.
10407 * If the length of the line is greater than the available space,
10413 * Load the line into the buffer.
10415 if(start_line != gl->line)
10420 for(cptr=gl->line + gl->ntotal - 1; cptr >= gl->line &&
10425 * Where should the cursor be placed within the line?
10435 * Clear the input line?
10441 * Arrange for the line to be displayed by gl_flush_output().
10451 * Reset all line input parameters for a new input line.
10454 * gl GetLine * The line editor resource object.
10459 gl->line[0] = '\0';
10472 gl->vi.undo.line[0] = '\0';
10482 * line.
10485 * gl GetLine * The line editor resource object.
10502 * Skip to the start of the next empty line before displaying the message.
10518 * Arrange for the input line to be redrawn.
10526 * Go to the start of the next empty line, ready to output miscellaneous
10533 * gl GetLine * The line editor resource object.
10545 * Move the cursor to the start of the terminal line that follows the
10546 * last line of the partially enterred line. In order that this
10552 if(gl->displayed) { /* Is an input line currently displayed? */
10555 * input line?
10560 * Move the cursor to the start of the line that follows the last
10561 * terminal line that is occupied by the input line.
10567 * Mark the line as no longer displayed.
10580 * data void * The pointer to a GetLine line editor resource object
10601 * gl GetLine * The line editor resource object.
10669 * call gl_raw_io() to redisplay the line and resume editing.
10674 * gl GetLine * The line editor resource object.
10747 * If an input line is being entered, arrange for it to be
10766 * gl GetLine * The line editor resource object.
10828 * Move the cursor to the next empty terminal line. Note that
10861 * gl GetLine * The resource object of the command-line input
10868 * to be completed from the input line, and
10990 * gl GetLine * The resource object of the command-line input
11124 status = a->fn(gl, a->data, count, gl->buff_curpos, gl->line);
11127 * mode, restore this mode, and queue a redisplay of the input line.
11253 * displayed at the start of each new terminal line used. Similarly,
11255 * each terminal line. If needed, a single paragraph can be broken
11260 * line is started between two words that are separated by spaces,
11261 * those spaces are not output, whereas when a new line is started
11268 * at the beginning of each new terminal line.
11271 * terminal line. You can specify NULL if no
11274 * of the terminal line. Spaces will be added
11276 * in the last column of the terminal line. If
11279 * the line or padding up to the suffix.
11284 * the start of the current terminal line. This
11288 * allow you to start the first line of a
11630 * processes, command-line editing will be suspended, the terminal
11634 * command-line editing is resumed.
11637 * resized, the new size will be queried, and any input line that is
11777 * Resume command-line editing.
11826 * the current incompletely entered input line, and prepare to start
11827 * editing a new line on the next call to gl_get_line().
11830 * gl GetLine * The line editor resource object.
11847 * Mark the input line as discarded.
11958 * If an input line is in the process of being edited, redisplay it to
11966 * Record a character in the input line buffer at a given position.
11987 gl->line[bufpos] = c;
11990 * line, update gl->ntotal to reflect the increased number of characters
11991 * that are in gl->line, and terminate the string.
11995 gl->line[gl->ntotal] = '\0';
12058 memmove(gl->line + start + n, gl->line + start, gl->ntotal - start + 1);
12060 * Update the recorded size of the line.
12078 memmove(gl->line + start, gl->line + start + n, gl->ntotal - start - n + 1);
12080 * Update the recorded size of the line.
12086 * Truncate the string in the input line buffer after a given number of
12091 * n int The new length of the line.
12100 gl->line[n] = '\0';
12106 * When the contents of gl->line[] are changed without calling any of the
12115 int len; /* The length of the line */
12117 * Measure the length of the input line.
12119 for(len=0; len <= gl->linelen && gl->line[len]; len++)
12124 gl->line[len] = '\0';
12126 * Record the number of characters that are now in gl->line[].
12131 * input line.
12136 * Arrange for the input line to be redrawn.
12143 * Erase the displayed input line, including its prompt, and leave the
12144 * cursor where the erased line started. Note that to allow this
12158 * Is a line currently displayed?
12162 * Relative the the start of the input line, which terminal line of
12163 * the current input line is the cursor currently on?
12167 * Move the cursor to the start of the line.
12176 * Clear from the start of the line to the end of the terminal.
12181 * Mark the line as no longer displayed.
12189 * Arrange for the input line to be redisplayed by gl_flush_output(),
12202 * Truncate the displayed input line starting from the current
12204 * truncated line. The input-line buffer is not affected.
12219 * First clear from the cursor to the end of the current input line.
12224 * If there is more than one line displayed, go to the start of the
12225 * next line and clear from there to the end of the display. Note that
12228 * clear_eod is only defined when used at the start of a terminal line
12230 * current terminal line, rather than from the current cursor
12279 * Read an input line from a non-interactive input stream.
12295 * If we are starting a new line, reset the line-input parameters.
12313 * properly terminated line. Otherwise return an end-of-file
12332 * Append the character to the line buffer.
12338 * Was the end of the input line reached before running out of buffer space?
12357 * Arrange to discard any incomplete input line.
12438 * redisplay the current input line.
12474 * line.
12487 * Append a specified line to the history list.
12491 * line const char * The line to be added.
12496 int gl_append_history(GetLine *gl, const char *line)
12504 if(!gl || !line) {
12516 status = _gl_append_history(gl, line);
12529 static int _gl_append_history(GetLine *gl, const char *line)
12531 int status =_glh_add_history(gl->glh, line, 0);
12677 * line.
12682 * Attempt to read the line. This will require more than one attempt if
12688 * Read a line from a non-interactive stream?
12716 * this would subseuqnely appear as bogus input to the line editor.