NAME_$READ_DIR_LC Domain/OS NAME_$READ_DIR_LC
NAME
name_$read_dir_lc - read a directory
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/name.h>
void name_$read_dir_lc(
char *dir_name,
unsigned short &name_length,
boolean *seek_to_bof,
name_$cursor_t *index,
unsigned short &max_count,
unsigned long &dir_list_size,
char *dir_list,
unsigned short *read_count,
status_$t *status)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/name.ins.pas';
procedure name_$read_dir_lc(
in dir_name: univ name_$long_pname_t;
in name_length: integer;
var seek_to_bof: boolean;
var index: name_$cursor_t;
in max_count: pinteger;
in dir_list_size: linteger;
out dir_list: univ name_$buf_t;
out read_count: pinteger;
out status: status_$t);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/name.ins.ftn'
integer*4 name_buf_size
parameter name_buf_size = 100000
character dir_name*1023, index*300, dir_list*(name_buf_size)
integer*2 name_length, max_count, read_count
logical seek_to_bof
integer*4 dir_list_size, status
character canonical_entry*278, entname*255
integer*2 entnxt, enttype, entlen
equivalence (entnxt, canonical_entry(1, 2))
equivalence (enttype, canonical_entry(3, 4))
equivalence (entlen, canonical_entry(21, 22))
equivalence (entname, canonical_entry(23, 278))
call name_$read_dir(dir_name, name_length, seek_to_bof,
& index, max_count, dir_list_size,
& dir_list, read_count, status)
DESCRIPTION
Name_$read_dir_lc supplies a list of up to max_count canonical directory
entries.
dir_name
The pathname of the directory to read.
name_length
The number of bytes in dir_name.
seek_to_bof
A Boolean that determines where name_$read_dir_lc will start reading
the directory. If seek_to_bof is true, name_$read_dir_lc starts at
the beginning of the directory and supplies the first entry of the
directory in dir_list. Otherwise, name_$read_dir_lc supplies the
next unread directory entry, as indicated by index.
To read an entire directory, set seek_to_bof to true on the first
call to name_$read_dir_lc and leave it alone for succeeding calls on
the directory; name_$read_dir_lc always sets seek_to_bof to false
before returning.
index
An argument used by name_$read_dir_lc to maintain its place in the
directory. Name_$read_dir_lc initializes and maintains its value,
and altering it between successive reads from a directory will con-
fuse the directory entry sequence returned in dir_list.
max_count
The maximum number of directory entries to read from dir_name.
dir_list_size
The number of bytes available in dir_list. Name_$read_dir_lc will
not write more than dir_list_size bytes into dir_list.
dir_list
A buffer for the canonical directory entries supplied by
name_$read_dir_lc.
read_count
The number of directory entries actually supplied in dir_list. If
there are less than max_count unread entries left in dir_name, then
read_count will be less than max_count. If there are no unread
entries left in dir_name when name_$read_dir_lc is called, then it
will return with a read_count of 0.
status
The completion status.