BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

karray_filelist - create an array of strings reflecting the contents of a file

LIBRARY CALL

char **karray_filelist(
   char   *filename,
   char   *global_dir,
   int     sort_flag,
   size_t *num)

INPUT

OUTPUT

RETURN VALUE

The array of strings representing the lines in the file on success, NULL on failure.

DESCRIPTION

Translates the contents of a file into an array of strings, where each string in the array is a line of the specified file. If desired, the resulting string array may also be sorted in alphabetical order.

The 'global_dir' parameter specifies the directory path to the file which will be used to create of the string array. This directory path may include toolbox names (for example, $BOOTSTRAP) or tildas (for example, ~fred). Passing NULL implies that the 'filename' parameter will be used to specify the directory as well as the filename.

The 'filename' parameter specifies the name of the file which is to have its contents translated into a string array. If the 'global_dir' parameter is used to specify the directory path, the 'filename' parameter should only contain the name of the file; if the 'global_dir' parameter is passed as NULL, then the 'filename' parameter must include the directory path to the file.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/kutils/src/array.c

SEE ALSO

kutils(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.