Print this page
12212 typos in some section 3tecla man pages

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3tecla/cpl_complete_word.3tecla.man.txt
          +++ new/usr/src/man/man3tecla/cpl_complete_word.3tecla.man.txt
↓ open down ↓ 123 lines elided ↑ open up ↑
 124  124         The cpl_add_completion() function is called zero or more times by the
 125  125         completion callback function to record each possible completion in the
 126  126         specified WordCompletion object. These completions are subsequently
 127  127         returned by cpl_complete_word(). The cpl, line, and word_end arguments
 128  128         should be those that were passed to the callback function. The
 129  129         word_start argument should be the index within the input line string of
 130  130         the start of the word that is being completed. This should equal
 131  131         word_end if a zero-length string is being completed. The suffix
 132  132         argument is the string that would have to be appended to the incomplete
 133  133         word to complete it. If this needs any quoting (for example, the
 134      -       addition of backslashes before special charaters) to be valid within
      134 +       addition of backslashes before special characters) to be valid within
 135  135         the displayed input line, this should be included. A copy of the suffix
 136  136         string is allocated internally, so there is no need to maintain your
 137  137         copy of the string after cpl_add_completion() returns.
 138  138  
 139  139  
 140  140         In the array of possible completions that the cpl_complete_word()
 141  141         function returns, the suffix recorded by cpl_add_completion() is listed
 142      -       along with the concatentation of this suffix with the word that lies
      142 +       along with the concatenation of this suffix with the word that lies
 143  143         between word_start and word_end in the input line.
 144  144  
 145  145  
 146  146         The type_suffix argument specifies an optional string to be appended to
 147  147         the completion if it is displayed as part of a list of completions by
 148      -       cpl_list_completions. The intention is that this indicate to the user
      148 +       cpl_list_completions. The intention is that this indicates to the user
 149  149         the type of each completion. For example, the file completion function
 150  150         places a directory separator after completions that are directories, to
 151      -       indicate their nature to the user. Similary, if the completion were a
      151 +       indicate their nature to the user. Similarly, if the completion were a
 152  152         function, you could indicate this to the user by setting type_suffix to
 153  153         "()". Note that the type_suffix string is not copied, so if the
 154  154         argument is not a literal string between speech marks, be sure that the
 155  155         string remains valid for at least as long as the results of
 156  156         cpl_complete_word() are needed.
 157  157  
 158  158  
 159  159         The cont_suffix argument is a continuation suffix to append to the
 160  160         completed word in the input line if this is the only completion. This
 161  161         is something that is not part of the completion itself, but that gives
 162  162         the user an indication about how they might continue to extend the
 163  163         token. For example, the file-completion callback function adds a
 164  164         directory separator if the completed word is a directory. If the
 165  165         completed word were a function name, you could similarly aid the user
 166  166         by arranging for an open parenthesis to be appended.
 167  167  
 168  168  
 169      -       The cpl_complete_word() is normally called behind the scenes by
 170      -       gl_get_line(3TECLA), but can also be called separately if you
      169 +       The cpl_complete_word() function is normally called behind the scenes
      170 +       by gl_get_line(3TECLA), but can also be called separately if you
 171  171         separately allocate a WordCompletion object. It performs word
 172  172         completion, as described at the beginning of this section. Its first
 173  173         argument is a resource object previously returned by
 174  174         new_WordCompletion(). The line argument is the input line string,
 175  175         containing the word to be completed. The word_end argument contains the
 176  176         index of the character in the input line, that just follows the last
 177  177         character of the word to be completed. When called by gl_get_line(),
 178  178         this is the character over which the user pressed TAB.  The match_fn
 179  179         argument is the function pointer of the callback function which will
 180  180         lookup possible completions of the word, as described above, and the
↓ open down ↓ 39 lines elided ↑ open up ↑
 220  220           } CplMatches;
 221  221  
 222  222  
 223  223  
 224  224         If an error occurs during completion, cpl_complete_word() returns NULL.
 225  225         A description of the error can be acquired by calling the
 226  226         cpl_last_error() function.
 227  227  
 228  228  
 229  229         The cpl_last_error() function returns a terse description of the error
 230      -       which occurred on the last call to cpl_com plete_word() or
      230 +       which occurred on the last call to cpl_complete_word() or
 231  231         cpl_add_completion().
 232  232  
 233  233  
 234  234         As a convenience, the return value of the last call to
 235  235         cpl_complete_word() can be recalled at a later time by calling
 236  236         cpl_recall_matches(). If cpl_complete_word() returned NULL, so will
 237  237         cpl_recall_matches().
 238  238  
 239  239  
 240  240         When the cpl_complete_word() function returns multiple possible
 241  241         completions, the cpl_list_completions() function can be called upon to
 242  242         list them, suitably arranged across the available width of the
 243  243         terminal. It arranges for the displayed columns of completions to all
 244  244         have the same width, set by the longest completion. It also appends the
 245  245         type_suffix strings that were recorded with each completion, thus
 246  246         indicating their types to the user.
 247  247  
 248  248     Builtin Filename completion Callback
 249      -       By default the gl_get_line() function, passes the
      249 +       By default the gl_get_line() function passes the
 250  250         CPL_MATCH_FN(cps_file_completions) completion callback function to
 251  251         cpl_complete_word(). This function can also be used separately, either
 252  252         by sending it to cpl_complete_word(), or by calling it directly from
 253  253         your own completion callback function.
 254  254  
 255  255           #define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
 256  256                                         void *data, const char *line, \
 257  257                                         int word_end)
 258  258  
 259  259           typedef CPL_MATCH_FN(CplMatchFn);
↓ open down ↓ 21 lines elided ↑ open up ↑
 281  281         at which the filename starts in the input line. Passing start_index=-1
 282  282         reenables the default behavior.
 283  283  
 284  284  
 285  285         By default, when cpl_file_completions() looks at a filename in the
 286  286         input line, each lone backslash in the input line is interpreted as
 287  287         being a special character which removes any special significance of the
 288  288         character which follows it, such as a space which should be taken as
 289  289         part of the filename rather than delimiting the start of the filename.
 290  290         These backslashes are thus ignored while looking for completions, and
 291      -       subsequently added before spaces, tabs and literal back slashes in the
 292      -       list of completions. To have unescaped back slashes treated as normal
      291 +       subsequently added before spaces, tabs and literal backslashes in the
      292 +       list of completions. To have unescaped backslashes treated as normal
 293  293         characters, call cfc_literal_escapes() with a non-zero value in its
 294  294         literal argument.
 295  295  
 296  296  
 297  297         By default, cpl_file_completions() reports all files whose names start
 298  298         with the prefix that is being completed. If you only want a selected
 299  299         subset of these files to be reported in the list of completions, you
 300  300         can arrange this by providing a callback function which takes the full
 301  301         pathname of a file, and returns 0 if the file should be ignored, or 1
 302  302         if the file should be included in the list of completions. To register
↓ open down ↓ 11 lines elided ↑ open up ↑
 314  314           typedef CPL_CHECK_FN(CplCheckFn);
 315  315  
 316  316           void cfc_set_check_fn(CplFileConf *cfc, CplCheckFn *chk_fn, \
 317  317                                                        void *chk_data);
 318  318  
 319  319  
 320  320  
 321  321         The cpl_check_exe() function is a provided callback of the above type,
 322  322         for use with cpl_file_completions(). It returns non-zero if the
 323  323         filename that it is given represents a normal file that the user has
 324      -       execute permission to. You could use this to have
      324 +       permission to execute. You could use this to have
 325  325         cpl_file_completions() only list completions of executable files.
 326  326  
 327  327  
 328  328         When you have finished with a CplFileConf variable, you can pass it to
 329  329         the del_CplFileConf() destructor function to reclaim its memory.
 330  330  
 331  331     Thread Safety
 332  332         It is safe to use the facilities of this module in multiple threads,
 333  333         provided that each thread uses a separately allocated WordCompletion
 334  334         object. In other words, if two threads want to do word completion, they
↓ open down ↓ 13 lines elided ↑ open up ↑
 348  348         +--------------------+-----------------+
 349  349         |MT-Level            | MT-Safe         |
 350  350         +--------------------+-----------------+
 351  351  
 352  352  SEE ALSO
 353  353         ef_expand_file(3TECLA), gl_get_line(3TECLA), libtecla(3LIB),
 354  354         pca_lookup_file(3TECLA), attributes(5)
 355  355  
 356  356  
 357  357  
 358      -                                 June 1, 2004        CPL_COMPLETE_WORD(3TECLA)
      358 +                               January 18, 2020      CPL_COMPLETE_WORD(3TECLA)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX