1 /* 2 * Public directory definitions for CUPS. 3 * 4 * This set of APIs abstracts enumeration of directory entries. 5 * 6 * Copyright 2007-2011 by Apple Inc. 7 * Copyright 1997-2006 by Easy Software Products, all rights reserved. 8 * 9 * These coded instructions, statements, and computer programs are the 10 * property of Apple Inc. and are protected by Federal copyright 11 * law. Distribution and use rights are outlined in the file "LICENSE.txt" 12 * which should have been included with this file. If this file is 13 * missing or damaged, see the license at "http://www.cups.org/". 14 */ 15 16 #ifndef _CUPS_DIR_H_ 17 # define _CUPS_DIR_H_ 18 19 20 /* 21 * Include necessary headers... 22 */ 23 24 # include "versioning.h" 25 # include <sys/stat.h> 26 27 28 /* 29 * C++ magic... 30 */ 31 32 # ifdef __cplusplus 33 extern "C" { 34 # endif /* __cplusplus */ 35 36 37 /* 38 * Data types... 39 */ 40 41 typedef struct _cups_dir_s cups_dir_t; /**** Directory type ****/ 42 43 typedef struct cups_dentry_s /**** Directory entry type ****/ 44 { 45 char filename[260]; /* File name */ 46 struct stat fileinfo; /* File information */ 47 } cups_dentry_t; 48 49 50 /* 51 * Prototypes... 52 */ 53 54 extern void cupsDirClose(cups_dir_t *dp) _CUPS_API_1_2; 55 extern cups_dir_t *cupsDirOpen(const char *directory) _CUPS_API_1_2; 56 extern cups_dentry_t *cupsDirRead(cups_dir_t *dp) _CUPS_API_1_2; 57 extern void cupsDirRewind(cups_dir_t *dp) _CUPS_API_1_2; 58 59 60 # ifdef __cplusplus 61 } 62 # endif /* __cplusplus */ 63 #endif /* !_CUPS_DIR_H_ */ 64