Lines Matching +full:check +full:- +full:macos
6 * Copyright 2007-2017 by Apple Inc.
7 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
16 #include "string-private.h"
17 #include "debug-internal.h"
41 * '_cups_dir_time()' - Convert a FILETIME value to a UNIX time value.
44 time_t /* O - UNIX time */
45 _cups_dir_time(FILETIME ft) /* I - File time */ in _cups_dir_time()
57 return ((time_t)(val / 10000000 - 11644732800)); in _cups_dir_time()
62 * 'cupsDirClose()' - Close a directory.
64 * @since CUPS 1.2/macOS 10.5@
68 cupsDirClose(cups_dir_t *dp) /* I - Directory pointer */ in cupsDirClose()
71 * Range check input... in cupsDirClose()
81 if (dp->dir != INVALID_HANDLE_VALUE) in cupsDirClose()
82 FindClose(dp->dir); in cupsDirClose()
93 * 'cupsDirOpen()' - Open a directory.
95 * @since CUPS 1.2/macOS 10.5@
98 cups_dir_t * /* O - Directory pointer or @code NULL@ if the directory could not be opened. */
99 cupsDirOpen(const char *directory) /* I - Directory name */ in cupsDirOpen()
105 * Range check input... in cupsDirOpen()
123 dp->dir = INVALID_HANDLE_VALUE; in cupsDirOpen()
125 strlcpy(dp->directory, directory, sizeof(dp->directory)); in cupsDirOpen()
136 * 'cupsDirRead()' - Read the next directory entry.
138 * @since CUPS 1.2/macOS 10.5@
141 cups_dentry_t * /* O - Directory entry or @code NULL@ if there are no more */
142 cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */ in cupsDirRead()
148 * Range check input... in cupsDirRead()
158 if (dp->dir == INVALID_HANDLE_VALUE) in cupsDirRead()
164 dp->dir = FindFirstFileA(dp->directory, &entry); in cupsDirRead()
165 if (dp->dir == INVALID_HANDLE_VALUE) in cupsDirRead()
168 else if (!FindNextFileA(dp->dir, &entry)) in cupsDirRead()
175 strlcpy(dp->entry.filename, entry.cFileName, sizeof(dp->entry.filename)); in cupsDirRead()
178 dp->entry.fileinfo.st_mode = 0755 | S_IFDIR; in cupsDirRead()
180 dp->entry.fileinfo.st_mode = 0644; in cupsDirRead()
182 dp->entry.fileinfo.st_atime = _cups_dir_time(entry.ftLastAccessTime); in cupsDirRead()
183 dp->entry.fileinfo.st_ctime = _cups_dir_time(entry.ftCreationTime); in cupsDirRead()
184 dp->entry.fileinfo.st_mtime = _cups_dir_time(entry.ftLastWriteTime); in cupsDirRead()
185 …dp->entry.fileinfo.st_size = entry.nFileSizeLow + ((unsigned long long)entry.nFileSizeHigh << 32); in cupsDirRead()
191 return (&(dp->entry)); in cupsDirRead()
196 * 'cupsDirRewind()' - Rewind to the start of the directory.
198 * @since CUPS 1.2/macOS 10.5@
202 cupsDirRewind(cups_dir_t *dp) /* I - Directory pointer */ in cupsDirRewind()
205 * Range check input... in cupsDirRewind()
215 if (dp->dir != INVALID_HANDLE_VALUE) in cupsDirRewind()
217 FindClose(dp->dir); in cupsDirRewind()
218 dp->dir = INVALID_HANDLE_VALUE; in cupsDirRewind()
246 * 'cupsDirClose()' - Close a directory.
248 * @since CUPS 1.2/macOS 10.5@
252 cupsDirClose(cups_dir_t *dp) /* I - Directory pointer */ in cupsDirClose()
257 * Range check input... in cupsDirClose()
267 closedir(dp->dir); in cupsDirClose()
273 * 'cupsDirOpen()' - Open a directory.
275 * @since CUPS 1.2/macOS 10.5@
278 cups_dir_t * /* O - Directory pointer or @code NULL@ if the directory could not be opened. */
279 cupsDirOpen(const char *directory) /* I - Directory name */ in cupsDirOpen()
287 * Range check input... in cupsDirOpen()
305 dp->dir = opendir(directory); in cupsDirOpen()
306 if (!dp->dir) in cupsDirOpen()
316 strlcpy(dp->directory, directory, sizeof(dp->directory)); in cupsDirOpen()
327 * 'cupsDirRead()' - Read the next directory entry.
329 * @since CUPS 1.2/macOS 10.5@
332 cups_dentry_t * /* O - Directory entry or @code NULL@ when there are no more */
333 cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */ in cupsDirRead()
342 * Range check input... in cupsDirRead()
358 if ((entry = readdir(dp->dir)) == NULL) in cupsDirRead()
364 DEBUG_printf(("4cupsDirRead: readdir() returned \"%s\"...", entry->d_name)); in cupsDirRead()
370 if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) in cupsDirRead()
377 strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename)); in cupsDirRead()
379 snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name); in cupsDirRead()
381 if (stat(filename, &(dp->entry.fileinfo))) in cupsDirRead()
383 DEBUG_printf(("3cupsDirRead: stat() failed for \"%s\" - %s...", filename, in cupsDirRead()
392 return (&(dp->entry)); in cupsDirRead()
398 * 'cupsDirRewind()' - Rewind to the start of the directory.
400 * @since CUPS 1.2/macOS 10.5@
404 cupsDirRewind(cups_dir_t *dp) /* I - Directory pointer */ in cupsDirRewind()
409 * Range check input... in cupsDirRewind()
419 rewinddir(dp->dir); in cupsDirRewind()