| 98 | */ |
| 99 | |
| 100 | cups_dir_t * /* O - Directory pointer or @code NULL@ if the directory could not be opened. */ |
| 101 | cupsDirOpen(const char *directory) /* I - Directory name */ |
| 102 | { |
| 103 | cups_dir_t *dp; /* Directory */ |
| 104 | |
| 105 | |
| 106 | /* |
| 107 | * Range check input... |
| 108 | */ |
| 109 | |
| 110 | if (!directory) |
| 111 | return (NULL); |
| 112 | |
| 113 | /* |
| 114 | * Allocate memory for the directory structure... |
| 115 | */ |
| 116 | |
| 117 | dp = (cups_dir_t *)calloc(1, sizeof(cups_dir_t)); |
| 118 | if (!dp) |
| 119 | return (NULL); |
| 120 | |
| 121 | /* |
| 122 | * Copy the directory name for later use... |
| 123 | */ |
| 124 | |
| 125 | dp->dir = INVALID_HANDLE_VALUE; |
| 126 | |
| 127 | snprintf(dp->directory, sizeof(dp->directory), "%s\\*", directory); |
| 128 | |
| 129 | /* |
| 130 | * Return the new directory structure... |
| 131 | */ |
| 132 | |
| 133 | return (dp); |
| 134 | } |
| 135 | |
| 136 | |
| 137 | /* |
no outgoing calls