"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/isc/win32/include/isc/dir.h" (7 Sep 2020, 1589 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


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 #include <windows.h>
   16 #include <stdbool.h>
   17 #include <stdlib.h>
   18 #include <direct.h>
   19 
   20 #include <isc/lang.h>
   21 #include <isc/platform.h>
   22 #include <isc/result.h>
   23 
   24 #define ISC_DIR_NAMEMAX NAME_MAX
   25 #define ISC_DIR_PATHMAX PATH_MAX
   26 
   27 typedef struct {
   28     char        name[NAME_MAX];
   29     unsigned int    length;
   30     WIN32_FIND_DATA find_data;
   31 } isc_direntry_t;
   32 
   33 typedef struct {
   34     unsigned int    magic;
   35     char        dirname[PATH_MAX];
   36     isc_direntry_t  entry;
   37     bool    entry_filled;
   38     HANDLE          search_handle;
   39 } isc_dir_t;
   40 
   41 ISC_LANG_BEGINDECLS
   42 
   43 void
   44 isc_dir_init(isc_dir_t *dir);
   45 
   46 isc_result_t
   47 isc_dir_open(isc_dir_t *dir, const char *dirname);
   48 
   49 isc_result_t
   50 isc_dir_read(isc_dir_t *dir);
   51 
   52 isc_result_t
   53 isc_dir_reset(isc_dir_t *dir);
   54 
   55 void
   56 isc_dir_close(isc_dir_t *dir);
   57 
   58 isc_result_t
   59 isc_dir_chdir(const char *dirname);
   60 
   61 isc_result_t
   62 isc_dir_chroot(const char *dirname);
   63 
   64 isc_result_t
   65 isc_dir_createunique(char *templet);
   66 /*
   67  * Use a templet (such as from isc_file_mktemplate()) to create a uniquely
   68  * named, empty directory.  The templet string is modified in place.
   69  * If result == ISC_R_SUCCESS, it is the name of the directory that was
   70  * created.
   71  */
   72 
   73 ISC_LANG_ENDDECLS
   74 
   75 #endif /* ISC_DIR_H */