1 /* Copied from Richard Levitte's (richard@levitte.org) LP library. All
2 * symbol names have been changed, with permission from the author. */
4 /* $LP: LPlib/source/LPdir.h,v 1.1 2004/06/14 08:56:04 _cvs_levitte Exp $ */
6 * Copyright (c) 2004, Richard Levitte <richard@levitte.org>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #ifndef OPENSSL_HEADER_DIRECTORY_H
32 #define OPENSSL_HEADER_DIRECTORY_H
34 #include <openssl/base.h>
36 #if defined(__cplusplus)
41 /* Directory functions abstract the O/S specific operations for opening and
42 * reading directories in the filesystem. */
45 /* OPENSSL_dir_context_st is an opaque structure that represents an open
46 * directory and a position in that directory. */
47 typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX;
49 /* OPENSSL_DIR_read reads a single filename from |ctx|. On the first call,
50 * |directory| must be given and |*ctx| must be NULL. Subsequent calls with the
51 * same |*ctx| will return subsequent file names until it returns NULL to
52 * indicate EOF. The strings returned reference a buffer internal to the
53 * |OPENSSL_DIR_CTX| and will be overridden by subsequent calls. */
54 OPENSSL_EXPORT const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx,
55 const char *directory);
57 /* OPENSSL_DIR_end closes |*ctx|. It returns one on success and zero on
59 OPENSSL_EXPORT int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx);
62 #if defined(__cplusplus)
66 #endif /* OPENSSL_HEADER_DIRECTORY_H */