mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 08:05:21 +00:00
New CPP macros ISC_DIR_NAMEMAX and ISC_DIR_PATHMAX; win32 are based
on _MAX_FNAME and _MAX_PATH, unix are "reasonable values" (256 and 1024) because unix is inconsistent about this.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dir.h,v 1.2 1999/10/01 01:12:04 tale Exp $ */
|
/* $Id: dir.h,v 1.3 1999/10/06 19:36:13 tale Exp $ */
|
||||||
|
|
||||||
/* Principal Authors: DCL */
|
/* Principal Authors: DCL */
|
||||||
|
|
||||||
@@ -31,6 +31,9 @@
|
|||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
|
#define ISC_DIR_NAMEMAX 256
|
||||||
|
#define ISC_DIR_PATHMAX 1024
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/*
|
/*
|
||||||
* Ideally, this should be NAME_MAX, but AIX does not define it by
|
* Ideally, this should be NAME_MAX, but AIX does not define it by
|
||||||
@@ -38,7 +41,7 @@ typedef struct {
|
|||||||
* complicates things undesirably, as does adding special conditionals
|
* complicates things undesirably, as does adding special conditionals
|
||||||
* just for AIX. So a comfortably sized buffer is chosen instead.
|
* just for AIX. So a comfortably sized buffer is chosen instead.
|
||||||
*/
|
*/
|
||||||
char name[256];
|
char name[ISC_DIR_NAMEMAX];
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
} isc_direntry_t;
|
} isc_direntry_t;
|
||||||
|
|
||||||
@@ -48,7 +51,7 @@ typedef struct {
|
|||||||
* As with isc_direntry_t->name, making this "right" for all systems
|
* As with isc_direntry_t->name, making this "right" for all systems
|
||||||
* is slightly problematic because AIX does not define PATH_MAX.
|
* is slightly problematic because AIX does not define PATH_MAX.
|
||||||
*/
|
*/
|
||||||
char dirname[1024];
|
char dirname[ISC_DIR_PATHMAX];
|
||||||
isc_direntry_t entry;
|
isc_direntry_t entry;
|
||||||
DIR * handle;
|
DIR * handle;
|
||||||
} isc_dir_t;
|
} isc_dir_t;
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dir.h,v 1.1 1999/09/23 17:31:59 tale Exp $ */
|
/* $Id: dir.h,v 1.2 1999/10/06 19:36:12 tale Exp $ */
|
||||||
|
|
||||||
/* Principal Authors: DCL */
|
/* Principal Authors: DCL */
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
#define DIRENT_H 1
|
#define DIRENT_H 1
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <isc/lang.h>
|
#include <isc/lang.h>
|
||||||
#include <isc/boolean.h>
|
#include <isc/boolean.h>
|
||||||
@@ -30,15 +31,18 @@
|
|||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
|
#define ISC_DIR_NAMEMAX _MAX_FNAME
|
||||||
|
#define ISC_DIR_PATHMAX _MAX_PATH
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char name[MAX_PATH];
|
char name[ISC_DIR_NAMEMAX];
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
WIN32_FIND_DATA find_data;
|
WIN32_FIND_DATA find_data;
|
||||||
} isc_direntry_t;
|
} isc_direntry_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int magic;
|
int magic;
|
||||||
char dirname[MAX_PATH];
|
char dirname[ISC_DIR_PATHMAX];
|
||||||
isc_direntry_t entry;
|
isc_direntry_t entry;
|
||||||
isc_boolean_t entry_filled;
|
isc_boolean_t entry_filled;
|
||||||
HANDLE search_handle;
|
HANDLE search_handle;
|
||||||
|
Reference in New Issue
Block a user