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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3tecla/pca_lookup_file.3tecla.man.txt
          +++ new/usr/src/man/man3tecla/pca_lookup_file.3tecla.man.txt
↓ open down ↓ 52 lines elided ↑ open up ↑
  53   53         list of directories, such as the UNIX execution PATH environment
  54   54         variable. Files in absolute directories are cached in a PathCache
  55   55         object, whereas relative directories are scanned as needed.  Using a
  56   56         PathCache object, you can look up the full pathname of a simple
  57   57         filename, or you can obtain a list of the possible completions of a
  58   58         given filename prefix. By default all files in the list of directories
  59   59         are targets for lookup and completion, but a versatile mechanism is
  60   60         provided for only selecting specific types of files. The obvious
  61   61         application of this facility is to provide Tab-completion and lookup of
  62   62         executable commands in the UNIX PATH, so an optional callback which
  63      -       rejects all but executable files, is provided.
       63 +       rejects all but executable files is provided.
  64   64  
  65   65     An Example
  66   66         Under UNIX, the following example program looks up and displays the
  67   67         full pathnames of each of the command names on the command line.
  68   68  
  69   69           #include <stdio.h>
  70   70           #include <stdlib.h>
  71   71           #include <libtecla.h>
  72   72  
  73   73           int main(int argc, char *argv[])
↓ open down ↓ 127 lines elided ↑ open up ↑
 201  201         suffix, you can arrange for the file completion and lookup functions to
 202  202         be selective in the filenames that they return. This is done by
 203  203         registering a callback function with your PathCache object. Thereafter,
 204  204         whenever a filename is found which either matches a filename being
 205  205         looked up or matches a prefix which is being completed, your callback
 206  206         function will be called with the full pathname of the file, plus any
 207  207         application-specific data that you provide. If the callback returns 1
 208  208         the filename will be reported as a match. If it returns 0, it will be
 209  209         ignored. Suitable callback functions and their prototypes should be
 210  210         declared with the following macro. The CplCheckFn typedef is also
 211      -       provided in case you wish to declare pointers to such functions
      211 +       provided in case you wish to declare pointers to such functions.
 212  212  
 213  213           #define CPL_CHECK_FN(fn) int (fn)(void *data, const char *pathname)
 214  214           typedef CPL_CHECK_FN(CplCheckFn);
 215  215  
 216  216  
 217  217  
 218  218         Registering one of these functions involves calling the
 219  219         pca_set_check_fn() function. In addition to the callback function
 220  220         passed with the check_fn argument, you can pass a pointer to anything
 221  221         with the data argument. This pointer will be passed on to your callback
↓ open down ↓ 17 lines elided ↑ open up ↑
 239  239         should be kept short.
 240  240  
 241  241  
 242  242         To improve performance, whenever one of these callbacks is called, the
 243  243         choice that it makes is cached, and the next time the corresponding
 244  244         file is looked up, instead of calling the callback again, the cached
 245  245         record of whether it was accepted or rejected is used. Thus if somebody
 246  246         tries to complete an empty string, and hits tab a second time when
 247  247         nothing appears to happen, there will only be one long delay, since the
 248  248         second pass will operate entirely from the cached dispositions of the
 249      -       files. These cached dipositions are discarded whenever pca_scan_path()
      249 +       files. These cached dispositions are discarded whenever pca_scan_path()
 250  250         is called, and whenever pca_set_check_fn() is called with changed
 251  251         callback function or data arguments.
 252  252  
 253  253     Error Handling
 254  254         If pca_scan_path() reports that an error occurred by returning 1, you
 255  255         can obtain a terse description of the error by calling
 256  256         pca_last_error(pc). This returns an internal string containing an error
 257  257         message.
 258  258  
 259  259     Cleaning Up
↓ open down ↓ 20 lines elided ↑ open up ↑
 280  280         +--------------------+-----------------+
 281  281         |MT-Level            | MT-Safe         |
 282  282         +--------------------+-----------------+
 283  283  
 284  284  SEE ALSO
 285  285         cpl_complete_word(3TECLA), ef_expand_file(3TECLA), gl_get_line(3TECLA),
 286  286         libtecla(3LIB), attributes(5)
 287  287  
 288  288  
 289  289  
 290      -                                August 13, 2007        PCA_LOOKUP_FILE(3TECLA)
      290 +                               January 18, 2020        PCA_LOOKUP_FILE(3TECLA)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX