"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/isc/unix/include/isc/dir.h" (4 Sep 2020, 1548 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "dir.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef ISC_DIR_H
   13 #define ISC_DIR_H 1
   14 
   15 /*! \file */
   16 
   17 #include <dirent.h>
   18 
   19 #include <isc/lang.h>
   20 #include <isc/platform.h>
   21 #include <isc/result.h>
   22 
   23 #include <sys/types.h> /* Required on some systems. */
   24 
   25 /*% Directory Entry */
   26 typedef struct isc_direntry {
   27     char         name[NAME_MAX];
   28     unsigned int length;
   29 } isc_direntry_t;
   30 
   31 /*% Directory */
   32 typedef struct isc_dir {
   33     unsigned int   magic;
   34     char           dirname[PATH_MAX];
   35     isc_direntry_t entry;
   36     DIR *          handle;
   37 } isc_dir_t;
   38 
   39 ISC_LANG_BEGINDECLS
   40 
   41 void
   42 isc_dir_init(isc_dir_t *dir);
   43 
   44 isc_result_t
   45 isc_dir_open(isc_dir_t *dir, const char *dirname);
   46 
   47 isc_result_t
   48 isc_dir_read(isc_dir_t *dir);
   49 
   50 isc_result_t
   51 isc_dir_reset(isc_dir_t *dir);
   52 
   53 void
   54 isc_dir_close(isc_dir_t *dir);
   55 
   56 isc_result_t
   57 isc_dir_chdir(const char *dirname);
   58 
   59 isc_result_t
   60 isc_dir_chroot(const char *dirname);
   61 
   62 isc_result_t
   63 isc_dir_createunique(char *templet);
   64 /*!<
   65  * Use a templet (such as from isc_file_mktemplate()) to create a uniquely
   66  * named, empty directory.  The templet string is modified in place.
   67  * If result == ISC_R_SUCCESS, it is the name of the directory that was
   68  * created.
   69  */
   70 
   71 ISC_LANG_ENDDECLS
   72 
   73 #endif /* ISC_DIR_H */