resolve.c

Resolve a UUID into a DDL file

Summary
resolve.cResolve a UUID into a DDL file
Files
resolve.cResolve a DCID (UUID) to a DDL module and return an open file descriptor.
Functions
openpathGeneric function that searches a path for a filename with one of a set of extensions.
openddlxOpen a ddl file or exit on failure.

Files

resolve.c

Resolve a DCID (UUID) to a DDL module and return an open file descriptor.  The returned file may be a socket or pipe.

FIXME

The resolver should perform the following steps.

1.  Check the file cache locations and known DDL directories and if the file is present, open and return it.  2. Search for the file using the supplied URL list.  The URL list may specify devices which must supply the file via TFTP (EPI-11), remote sites which may supply the file if an internet connection is available, other local machines which may cache DDL modules, etc.  3. Split the file if it contains multiple modules 4.  Return an open file descriptior for the file

Currently it only implements step one.  It looks for the file in a path, optionally with one of the supplied extensions.

Functions

openpath

int openpath(const char *path,
const char *name,
const char *exts)

Generic function that searches a path for a filename with one of a set of extensions.

Returns

an open file descriptor for the first matching file found, or -1 if no match is found or the file cannot be opened.

Files are opened read only.

openddlx

int openddlx(ddlchar_t *name)

Open a ddl file or exit on failure.

If the supplied name looks like a UUID string it is converted to lower case which is the convention used for UUID file-names (should use a full case insensitive file search here).  Then the path is searched for name, name.ddl or name.xml.  If the file is fouind the opened file descriptor is returned.  If it cannot be found openddlx() quits (should do better here!).

The path is given by the environment variable DDL_PATH.  If this isn’t found then the default $HOME/.acacian/ddlcache is used.

int openpath(const char *path,
const char *name,
const char *exts)
Generic function that searches a path for a filename with one of a set of extensions.
int openddlx(ddlchar_t *name)
Open a ddl file or exit on failure.
Close