/haiku/src/system/libroot/posix/ |
H A D | dirent.cpp | 36 do_seek_dir(DIR* dir) in do_seek_dir() argument 38 if (dir->seek_position == dir->current_position) in do_seek_dir() 43 if (dir->seek_position < dir->current_position) { in do_seek_dir() 44 status_t status = _kern_rewind_dir(dir->fd); in do_seek_dir() 50 dir->current_position = 0; in do_seek_dir() 51 dir->entries_left = 0; in do_seek_dir() 55 while (dir->seek_position > dir->current_position) { in do_seek_dir() 57 long toSkip = dir->seek_position - dir->current_position; in do_seek_dir() 58 if (toSkip == dir->entries_left) { in do_seek_dir() 60 dir->current_position = dir->seek_position; in do_seek_dir() [all …]
|
/haiku/src/tests/kits/storage/ |
H A D | DirectoryTest.cpp | 118 BDirectory dir; in InitTest1() local 119 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT ); in InitTest1() 125 BDirectory dir(existing); in InitTest1() local 126 CPPUNIT_ASSERT( dir.InitCheck() == B_OK ); in InitTest1() 130 BDirectory dir(nonExisting); in InitTest1() local 131 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND ); in InitTest1() 135 BDirectory dir((const char *)NULL); in InitTest1() local 136 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE ); in InitTest1() 140 BDirectory dir(""); in InitTest1() local 142 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND ); in InitTest1() [all …]
|
/haiku/src/tests/system/libroot/posix/ |
H A D | dirent_test.cpp | 16 DIR* dir = opendir("."); in main() local 20 dirent = readdir(dir); in main() 29 rewinddir(dir); in main() 32 dirent = readdir(dir); in main() 42 closedir(dir); in main() 47 dir = opendir("."); in main() 51 if (readdir_r(dir, buf, &dirent) != 0 || dirent == NULL) in main() 59 rewinddir(dir); in main() 62 if (readdir_r(dir, buf, &dirent) != 0 || dirent == NULL) in main() 70 closedir(dir); in main()
|
H A D | fifo_test.cpp | 24 DIR* dir = opendir(filename); in main() local 25 if (dir != NULL) { in main() 30 dir = fdopendir(rfd); in main() 31 if (dir != NULL) { in main()
|
/haiku/src/system/libroot/posix/glibc/libio/ |
H A D | ioseekoff.c | 33 _IO_seekoff_unlocked (fp, offset, dir, mode) in _IO_seekoff_unlocked() argument 36 int dir; 39 if (dir != _IO_seek_cur && dir != _IO_seek_set && dir != _IO_seek_end) 51 if (dir == _IO_seek_cur && _IO_in_backup (fp)) 64 return _IO_SEEKOFF (fp, offset, dir, mode); 69 _IO_seekoff (fp, offset, dir, mode) in _IO_seekoff() argument 72 int dir; 80 retval = _IO_seekoff_unlocked (fp, offset, dir, mode);
|
/haiku/src/system/kernel/fs/ |
H A D | rootfs.cpp | 58 } dir; member 142 rootfs_check_permissions(struct rootfs_vnode* dir, int accessMode) in rootfs_check_permissions() argument 144 return check_access_permissions(accessMode, dir->stream.type, (gid_t)dir->gid, (uid_t)dir->uid); in rootfs_check_permissions() 197 list_init(&vnode->stream.dir.cookies); in rootfs_create_vnode() 198 mutex_init(&vnode->stream.dir.cookie_lock, "rootfs dir cookies"); in rootfs_create_vnode() 210 if (!force_delete && (v->stream.dir.dir_head != NULL || v->dir_next != NULL)) in rootfs_delete_vnode() 217 mutex_destroy(&v->stream.dir.cookie_lock); in rootfs_delete_vnode() 228 update_dir_cookies(struct rootfs_vnode* dir, struct rootfs_vnode* vnode) in update_dir_cookies() argument 233 &dir->stream.dir.cookies, cookie)) != NULL) { in update_dir_cookies() 242 rootfs_find_in_dir(struct rootfs_vnode* dir, const char* path) in rootfs_find_in_dir() argument [all …]
|
/haiku/src/system/libroot/posix/musl/search/ |
H A D | tsearch.c | 7 static int rot(void **p, struct node *x, int dir /* deeper side */) in rot() argument 9 struct node *y = x->a[dir]; in rot() 10 struct node *z = y->a[!dir]; in rot() 13 if (hz > height(y->a[dir])) { in rot() 23 x->a[dir] = z->a[!dir]; in rot() 24 y->a[!dir] = z->a[dir]; in rot() 25 z->a[!dir] = x; in rot() 26 z->a[dir] = y; in rot() 38 x->a[dir] = z; in rot() 39 y->a[!dir] = x; in rot()
|
/haiku/headers/posix/ |
H A D | dirent.h | 41 struct dirent* readdir(DIR* dir); 42 int readdir_r(DIR* dir, struct dirent* entry, 44 int closedir(DIR* dir); 45 void rewinddir(DIR* dir); 46 void seekdir(DIR* dir, long int position); 47 long int telldir(DIR* dir); 48 int dirfd(DIR* dir); 52 int scandir(const char* dir, struct dirent*** _entryArray,
|
/haiku/src/apps/mail/ |
H A D | Status.cpp | 116 BDirectory dir; in MessageReceived() local 123 dir.SetTo(path.Path()); in MessageReceived() 124 if (dir.FindEntry("Mail", &entry) == B_NO_ERROR) in MessageReceived() 125 dir.SetTo(&entry); in MessageReceived() 127 dir.CreateDirectory("Mail", &dir); in MessageReceived() 128 if (dir.InitCheck() != B_NO_ERROR) in MessageReceived() 130 if (dir.FindEntry("status", &entry) == B_NO_ERROR) in MessageReceived() 131 dir.SetTo(&entry); in MessageReceived() 133 dir.CreateDirectory("status", &dir); in MessageReceived() 134 if (dir.InitCheck() == B_NO_ERROR) { in MessageReceived() [all …]
|
/haiku/src/system/libroot/os/ |
H A D | fs_index.c | 60 DIR *dir; in fs_open_index_dir() local 69 if ((dir = __create_dir_struct(fd)) == NULL) { in fs_open_index_dir() 75 return dir; in fs_open_index_dir() 80 fs_close_index_dir(DIR *dir) in fs_close_index_dir() argument 82 return closedir(dir); in fs_close_index_dir() 87 fs_read_index_dir(DIR *dir) in fs_read_index_dir() argument 89 return readdir(dir); in fs_read_index_dir() 94 fs_rewind_index_dir(DIR *dir) in fs_rewind_index_dir() argument 96 rewinddir(dir); in fs_rewind_index_dir()
|
H A D | fs_attr.cpp | 23 DIR *dir; in open_attr_dir() local 32 if ((dir = __create_dir_struct(fd)) == NULL) { in open_attr_dir() 37 return dir; in open_attr_dir() 142 fs_close_attr_dir(DIR* dir) in fs_close_attr_dir() argument 144 return closedir(dir); in fs_close_attr_dir() 149 fs_read_attr_dir(DIR* dir) in fs_read_attr_dir() argument 151 return readdir(dir); in fs_read_attr_dir() 156 fs_rewind_attr_dir(DIR* dir) in fs_rewind_attr_dir() argument 158 rewinddir(dir); in fs_rewind_attr_dir()
|
H A D | fs_query.cpp | 38 DIR *dir = __create_dir_struct(fd); in open_query_etc() local 39 if (dir == NULL) { in open_query_etc() 44 return dir; in open_query_etc() 70 fs_close_query(DIR *dir) in fs_close_query() argument 72 return closedir(dir); in fs_close_query() 77 fs_read_query(DIR *dir) in fs_read_query() argument 79 return readdir(dir); in fs_read_query()
|
/haiku/src/system/libroot/posix/glibc/stdio-common/ |
H A D | tempname.c | 135 int __path_search(char *tmpl, size_t tmpl_len, const char *dir, 141 direxists(const char *dir) in direxists() argument 144 return stat(dir, &st) == 0 && S_ISDIR(st.st_mode); in direxists() 155 __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, in __path_search() argument 177 dir = d; in __path_search() 178 else if (dir != NULL && direxists (dir)) in __path_search() 181 dir = NULL; in __path_search() 183 if (dir == NULL) in __path_search() 186 dir = P_tmpdir; in __path_search() 188 dir = "/tmp"; in __path_search() [all …]
|
/haiku/src/bin/bfs_tools/ |
H A D | recover.cpp | 351 checkDirectoryContents(Disk& disk, Directory *dir) in checkDirectoryContents() argument 353 dir->Rewind(); in checkDirectoryContents() 358 while (dir->GetNextEntry(name, &run) == B_OK) { in checkDirectoryContents() 359 if (run == dir->BlockRun() || run == dir->Parent() in checkDirectoryContents() 375 missing->SetParent(dir->BlockRun()); in checkDirectoryContents() 388 "missing (%" B_PRId32 ", %d, %d)\n", dir->Name(), in checkDirectoryContents() 389 dir->BlockRun().allocation_group, in checkDirectoryContents() 390 dir->BlockRun().start, name, in checkDirectoryContents() 398 if (missing->InodeBuffer()->parent != dir->BlockRun()) { in checkDirectoryContents() 402 missing->SetParent(dir->BlockRun()); in checkDirectoryContents() [all …]
|
/haiku/data/bin/ |
H A D | install-wifi-firmwares.sh | 97 local dir=$3 99 mkdir -p "$dir" 100 if [ ! -e $dir/$file ] ; then 102 wget -nv -O $dir/$file $url 154 local dir="${tempFirmwareDir}/${driver}" 155 cp "${firmwareDir}/${driver}/${file}" "${dir}" 156 DownloadFileIfNotCached $url $file $dir 175 local dir="${tempFirmwareDir}/${driver}" 176 cp "${firmwareDir}/${driver}/${file}" "${dir}" 177 DownloadFileIfNotCached $url $file $dir [all …]
|
/haiku/src/kits/storage/ |
H A D | SymLink.cpp | 69 BSymLink::BSymLink(const BDirectory* dir, const char* path) in BSymLink() argument 71 BNode(dir, path) in BSymLink() 116 BDirectory dir(dirPath); in MakeLinkedPath() local 117 ssize_t result = dir.InitCheck(); in MakeLinkedPath() 119 result = MakeLinkedPath(&dir, path); in MakeLinkedPath() 128 BSymLink::MakeLinkedPath(const BDirectory* dir, BPath* path) in MakeLinkedPath() argument 130 if (dir == NULL || path == NULL) in MakeLinkedPath() 139 result = path->SetTo(dir, contents); in MakeLinkedPath()
|
/haiku/headers/private/fs_shell/ |
H A D | fssh_dirent.h | 34 struct fssh_dirent *fssh_readdir(fssh_DIR *dir); 35 int fssh_readdir_r(fssh_DIR *dir, struct fssh_dirent *entry, 37 int fssh_closedir(fssh_DIR *dir); 38 void fssh_rewinddir(fssh_DIR *dir); 39 void fssh_seekdir(fssh_DIR *dir, long int loc);
|
/haiku/src/bin/ |
H A D | fortune.c | 27 DIR *dir = opendir(path); in choose_file() local 28 if (dir == NULL) in choose_file() 33 while ((dirent = readdir(dir)) != NULL) { in choose_file() 41 closedir(dir); in choose_file() 48 rewinddir(dir); in choose_file() 50 while ((dirent = readdir(dir)) != NULL) { in choose_file() 65 closedir(dir); in choose_file() 72 closedir(dir); in choose_file()
|
/haiku/src/bin/rc/ |
H A D | rdef.cpp | 61 rdef_add_include_dir(const char *dir, bool toEndOfList) in rdef_add_include_dir() argument 65 char *path = (char *)malloc(strlen(dir) + 2); in rdef_add_include_dir() 71 strcpy(path, dir); in rdef_add_include_dir() 84 rdef_remove_include_dir(const char *dir) in rdef_remove_include_dir() argument 86 size_t length = strlen(dir); in rdef_remove_include_dir() 88 if (dir[length - 1] != '/') in rdef_remove_include_dir() 94 if (!strncmp(dir, path, length) in rdef_remove_include_dir()
|
/haiku/src/add-ons/kernel/file_systems/netfs/server/ |
H A D | FDManager.cpp | 180 FDManager::OpenDir(const char* path, DIR*& dir) in OpenDir() argument 183 dir = opendir(path); in OpenDir() 184 if (!dir) in OpenDir() 191 dir = opendir(path); in OpenDir() 192 if (!dir) in OpenDir() 201 FDManager::OpenAttrDir(const char* path, DIR*& dir) in OpenAttrDir() argument 204 dir = fs_open_attr_dir(path); in OpenAttrDir() 205 if (!dir) in OpenAttrDir() 212 dir = fs_open_attr_dir(path); in OpenAttrDir() 213 if (!dir) in OpenAttrDir()
|
/haiku/src/apps/login/ |
H A D | DesktopWindow.cpp | 47 BDirectory dir(path.Path()); in DesktopWindow() local 48 if (!dir.Contains("x-vnd.Haiku-Login", B_DIRECTORY_NODE)) in DesktopWindow() 49 dir.CreateDirectory("x-vnd.Haiku-Login", NULL); in DesktopWindow() 51 dir.SetTo(path.Path()); in DesktopWindow() 52 if (!dir.Contains("Shelf", B_FILE_NODE)) in DesktopWindow() 53 dir.CreateFile("Shelf", NULL); in DesktopWindow()
|
/haiku/src/libs/print/libprint/ |
H A D | DbgMsg.cpp | 176 void DUMP_BDIRECTORY(BDirectory *dir) in DUMP_BDIRECTORY() argument 178 DUMP_BNODE(dir); in DUMP_BDIRECTORY() 181 void DUMP_BNODE(BNode *dir) in DUMP_BNODE() argument 193 dir->RewindAttrs(); in DUMP_BNODE() 194 while (dir->GetNextAttrName(buffer1) == B_NO_ERROR) { in DUMP_BNODE() 195 dir->GetAttrInfo(buffer1, &info); in DUMP_BNODE() 198 dir->ReadAttr(buffer1, info.type, 0, buffer2, sizeof(buffer2)); in DUMP_BNODE() 202 dir->ReadAttr(buffer1, info.type, 0, buffer2, sizeof(buffer2)); in DUMP_BNODE() 206 dir->ReadAttr(buffer1, info.type, 0, &i, sizeof(i)); in DUMP_BNODE() 210 dir->ReadAttr(buffer1, info.type, 0, &f, sizeof(f)); in DUMP_BNODE() [all …]
|
/haiku/src/build/libroot/ |
H A D | fs_attr_haiku.cpp | 87 _haiku_build_fs_close_attr_dir(DIR *dir) in _haiku_build_fs_close_attr_dir() argument 89 return fs_close_attr_dir(dir); in _haiku_build_fs_close_attr_dir() 94 _haiku_build_fs_read_attr_dir(DIR *dir) in _haiku_build_fs_read_attr_dir() argument 96 return fs_read_attr_dir(dir); in _haiku_build_fs_read_attr_dir() 101 _haiku_build_fs_rewind_attr_dir(DIR *dir) in _haiku_build_fs_rewind_attr_dir() argument 103 return fs_rewind_attr_dir(dir); in _haiku_build_fs_rewind_attr_dir() 275 DIR* dir; in _kern_open_attr_dir() local 283 dir = _haiku_build_fs_open_attr_dir(realPath.c_str()); in _kern_open_attr_dir() 285 dir = _haiku_build_fs_fopen_attr_dir(fd); in _kern_open_attr_dir() 287 if (!dir) in _kern_open_attr_dir() [all …]
|
/haiku/src/add-ons/print/transports/lpr/ |
H A D | LprTransport.cpp | 48 BDirectory dir(spool_path); in LprTransport() local 49 DUMP_BDIRECTORY(&dir); in LprTransport() 51 dir.ReadAttr(LPR_SERVER_NAME, B_STRING_TYPE, 0, fServer, sizeof(fServer)); in LprTransport() 53 LprSetupDlg *dlg = new LprSetupDlg(&dir); in LprTransport() 60 dir.ReadAttr(LPR_SERVER_NAME, B_STRING_TYPE, 0, fServer, sizeof(fServer)); in LprTransport() 61 dir.ReadAttr(LPR_QUEUE_NAME, B_STRING_TYPE, 0, fQueue, sizeof(fQueue)); in LprTransport() 62 dir.ReadAttr(LPR_JOB_ID, B_INT32_TYPE, 0, &fJobId, sizeof(fJobId)); in LprTransport() 67 dir.WriteAttr(LPR_JOB_ID, B_INT32_TYPE, 0, &fJobId, sizeof(fJobId)); in LprTransport()
|
/haiku/src/system/boot/loader/ |
H A D | vfs.cpp | 1155 directory_from(DIR* dir) in directory_from() argument 1157 return dir != NULL ? dir->directory : NULL; in directory_from() 1199 DIR* dir = new(std::nothrow) DIR; in open_directory() local 1200 if (dir == NULL) { in open_directory() 1204 ObjectDeleter<DIR> dirDeleter(dir); in open_directory() 1219 dir->directory = static_cast<Directory*>(node); in open_directory() 1221 error = dir->directory->Open(&dir->cookie, O_RDONLY); in open_directory() 1240 closedir(DIR* dir) in closedir() argument 1242 if (dir != NULL) { in closedir() 1243 dir->directory->Close(dir->cookie); in closedir() [all …]
|