+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -87,11 +87,11 @@ private:
|
||||
|
||||
private:
|
||||
virtual void close_fd();
|
||||
StorageKit::FileDescriptor get_fd() const;
|
||||
BPrivate::Storage::FileDescriptor get_fd() const;
|
||||
|
||||
private:
|
||||
uint32 _reservedData[7];
|
||||
StorageKit::FileDescriptor fDirFd;
|
||||
BPrivate::Storage::FileDescriptor fDirFd;
|
||||
|
||||
friend class BEntry;
|
||||
};
|
||||
@@ -107,3 +107,5 @@ status_t create_directory(const char *path, mode_t mode);
|
||||
#endif
|
||||
|
||||
#endif // _DIRECTORY_H
|
||||
|
||||
|
||||
|
||||
@@ -90,11 +90,11 @@ private:
|
||||
/*! BEntry implementation of BStatable::set_stat() */
|
||||
virtual status_t set_stat(struct stat &st, uint32 what);
|
||||
|
||||
status_t set(StorageKit::FileDescriptor dir, const char *path,
|
||||
status_t set(BPrivate::Storage::FileDescriptor dir, const char *path,
|
||||
bool traverse);
|
||||
|
||||
/*! File descriptor for the entry's parent directory. */
|
||||
StorageKit::FileDescriptor fDirFd;
|
||||
BPrivate::Storage::FileDescriptor fDirFd;
|
||||
|
||||
/*! Leaf name of the entry. */
|
||||
char *fName;
|
||||
@@ -118,3 +118,7 @@ bool operator<(const entry_ref &a, const entry_ref &b);
|
||||
#endif
|
||||
|
||||
#endif // _ENTRY_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -58,3 +58,5 @@ private:
|
||||
#endif
|
||||
|
||||
#endif // _ENTRY_LIST_H
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ private:
|
||||
uint32 _reservedData[8];
|
||||
|
||||
private:
|
||||
StorageKit::FileDescriptor get_fd() const;
|
||||
BPrivate::Storage::FileDescriptor get_fd() const;
|
||||
|
||||
private:
|
||||
//! The file's open mode.
|
||||
@@ -83,3 +83,5 @@ private:
|
||||
#endif
|
||||
|
||||
#endif // _FILE_H
|
||||
|
||||
|
||||
|
||||
@@ -133,3 +133,5 @@ status_t find_directory(directory_which which, BPath *path,
|
||||
#endif
|
||||
|
||||
#endif // _FIND_DIRECTORY_H
|
||||
|
||||
|
||||
|
||||
@@ -43,3 +43,5 @@ enum icon_size {
|
||||
#endif
|
||||
|
||||
#endif // _MIME_H
|
||||
|
||||
|
||||
|
||||
@@ -191,3 +191,5 @@ private:
|
||||
|
||||
|
||||
#endif // _MIME_TYPE_H
|
||||
|
||||
|
||||
|
||||
@@ -115,14 +115,14 @@ private:
|
||||
uint32 rudeData[4];
|
||||
|
||||
private:
|
||||
status_t set_fd(StorageKit::FileDescriptor fd);
|
||||
status_t set_fd(BPrivate::Storage::FileDescriptor fd);
|
||||
virtual void close_fd();
|
||||
void set_status(status_t newStatus);
|
||||
|
||||
virtual status_t set_stat(struct stat &st, uint32 what);
|
||||
|
||||
StorageKit::FileDescriptor fFd;
|
||||
StorageKit::FileDescriptor fAttrFd;
|
||||
BPrivate::Storage::FileDescriptor fFd;
|
||||
BPrivate::Storage::FileDescriptor fAttrFd;
|
||||
status_t fCStatus;
|
||||
|
||||
status_t InitAttrDir();
|
||||
@@ -135,3 +135,5 @@ private:
|
||||
#endif
|
||||
|
||||
#endif // _NODE_H
|
||||
|
||||
|
||||
|
||||
@@ -87,3 +87,5 @@ private:
|
||||
#endif // USE_OPENBEOS_NAMESPACE
|
||||
|
||||
#endif // _NODE_INFO_H
|
||||
|
||||
|
||||
|
||||
@@ -98,3 +98,5 @@ private:
|
||||
#endif
|
||||
|
||||
#endif // _PATH_H
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
class BVolume;
|
||||
struct entry_ref;
|
||||
|
||||
namespace StorageKit {
|
||||
class QueryNode;
|
||||
class QueryStack;
|
||||
class QueryTree;
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
class QueryNode;
|
||||
class QueryStack;
|
||||
class QueryTree;
|
||||
};
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
@@ -97,7 +99,7 @@ public:
|
||||
|
||||
private:
|
||||
bool _HasFetched() const;
|
||||
status_t _PushNode(StorageKit::QueryNode *node, bool deleteOnError);
|
||||
status_t _PushNode(BPrivate::Storage::QueryNode *node, bool deleteOnError);
|
||||
status_t _SetPredicate(const char *expression);
|
||||
status_t _EvaluateStack();
|
||||
|
||||
@@ -111,13 +113,15 @@ private:
|
||||
|
||||
private:
|
||||
int32 _reservedData[4]; // FBC
|
||||
StorageKit::QueryStack *fStack;
|
||||
BPrivate::Storage::QueryStack *fStack;
|
||||
char *fPredicate;
|
||||
dev_t fDevice;
|
||||
bool fLive;
|
||||
port_id fPort;
|
||||
long fToken;
|
||||
StorageKit::FileDescriptor fQueryFd;
|
||||
BPrivate::Storage::FileDescriptor fQueryFd;
|
||||
};
|
||||
|
||||
#endif // _QUERY_H
|
||||
|
||||
|
||||
|
||||
@@ -88,3 +88,5 @@ private:
|
||||
};
|
||||
|
||||
#endif // _RESOURCE_STRINGS_H
|
||||
|
||||
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
namespace StorageKit {
|
||||
class ResourcesContainer;
|
||||
class ResourceFile;
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
class ResourcesContainer;
|
||||
class ResourceFile;
|
||||
};
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -99,8 +101,8 @@ private:
|
||||
|
||||
private:
|
||||
BFile fFile;
|
||||
StorageKit::ResourcesContainer *fContainer;
|
||||
StorageKit::ResourceFile *fResourceFile;
|
||||
BPrivate::Storage::ResourcesContainer *fContainer;
|
||||
BPrivate::Storage::ResourceFile *fResourceFile;
|
||||
bool fReadOnly;
|
||||
bool _pad[3];
|
||||
uint32 _reserved[3]; // FBC
|
||||
@@ -112,3 +114,5 @@ private:
|
||||
#endif
|
||||
|
||||
#endif // _RESOURCES_H
|
||||
|
||||
|
||||
|
||||
@@ -81,3 +81,5 @@ public:
|
||||
#endif // USE_OPENBEOS_NAMESPACE
|
||||
|
||||
#endif // _STATABLE_H
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
#ifndef _DEF_STORAGE_PRIVATE_H
|
||||
#define _DEF_STORAGE_PRIVATE_H
|
||||
|
||||
namespace StorageKit {
|
||||
typedef int FileDescriptor;
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
typedef int FileDescriptor;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _DEF_STORAGE_PRIVATE_H
|
||||
|
||||
|
||||
|
||||
@@ -54,3 +54,5 @@ enum node_flavor {
|
||||
|
||||
|
||||
#endif // _DEF_STORAGE_H
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
// WORKAROUND
|
||||
// SetTo() methods: Part of a work around until someone has an idea how to
|
||||
// get StorageKit::read_link(FileDescriptor,...) to work.
|
||||
// get BPrivate::Storage::read_link(FileDescriptor,...) to work.
|
||||
status_t SetTo(const entry_ref *ref);
|
||||
status_t SetTo(const BEntry *entry);
|
||||
status_t SetTo(const char *path);
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
// WORKAROUND
|
||||
// operator=(): Part of a work around until someone has an idea how to
|
||||
// get StorageKit::read_link(FileDescriptor,...) to work.
|
||||
// get BPrivate::Storage::read_link(FileDescriptor,...) to work.
|
||||
BSymLink &operator=(const BSymLink &link);
|
||||
|
||||
private:
|
||||
@@ -70,13 +70,13 @@ private:
|
||||
|
||||
// WORKAROUND
|
||||
// fSecretEntry: Part of a work around until someone has an idea how to
|
||||
// get StorageKit::read_link(FileDescriptor,...) to work.
|
||||
// get BPrivate::Storage::read_link(FileDescriptor,...) to work.
|
||||
// uint32 _reservedData[4];
|
||||
uint32 _reservedData[3];
|
||||
BEntry *fSecretEntry;
|
||||
|
||||
private:
|
||||
StorageKit::FileDescriptor get_fd() const;
|
||||
BPrivate::Storage::FileDescriptor get_fd() const;
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
@@ -84,3 +84,5 @@ private:
|
||||
#endif
|
||||
|
||||
#endif // _SYM_LINK_H
|
||||
|
||||
|
||||
|
||||
@@ -105,3 +105,5 @@ class BVolume {
|
||||
#endif
|
||||
|
||||
#endif // _VOLUME_H
|
||||
|
||||
|
||||
|
||||
@@ -62,3 +62,5 @@ class BVolumeRoster {
|
||||
#endif
|
||||
|
||||
#endif // _VOLUME_ROSTER_H
|
||||
|
||||
|
||||
|
||||
@@ -103,3 +103,5 @@ typedef struct {
|
||||
#define SHT_HIUSER 0xffffffff
|
||||
|
||||
#endif // _ELF_H
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
#include <String.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
class Exception {
|
||||
public:
|
||||
@@ -106,6 +107,9 @@ private:
|
||||
BString fDescription;
|
||||
};
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _EXCEPTION_H
|
||||
|
||||
|
||||
|
||||
@@ -17,3 +17,5 @@ extern status_t swap_data_adapter(type_code type, void *data, size_t length,
|
||||
extern bool is_type_swapped_adapter(type_code type);
|
||||
|
||||
#endif // _LIB_BE_ADAPTER_H
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include <DataIO.h>
|
||||
#include <File.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
/*!
|
||||
\class OffsetFile
|
||||
@@ -58,6 +59,9 @@ private:
|
||||
off_t fCurrentPosition;
|
||||
};
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _OFFSET_FILE_H
|
||||
|
||||
|
||||
|
||||
@@ -44,3 +44,5 @@ struct PEFSectionHeader {
|
||||
const uint32 kPEFSectionHeaderSize = 28;
|
||||
|
||||
#endif // _PEF_H
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
#include <Query.h>
|
||||
#include <String.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// QueryNode
|
||||
class QueryNode {
|
||||
@@ -201,6 +202,9 @@ private:
|
||||
BList fNodes;
|
||||
};
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _QUERY_PREDICATE_H
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
struct resource_info;
|
||||
struct PEFContainerHeader;
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
class Exception;
|
||||
struct MemArea;
|
||||
@@ -123,6 +124,9 @@ ResourceFile::_GetUInt32(uint32 value)
|
||||
return (fHostEndianess ? value : B_SWAP_INT32(value));
|
||||
}
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _RESOURCE_FILE_H
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include <DataIO.h>
|
||||
#include <String.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
/*!
|
||||
\class ResourceItem
|
||||
@@ -82,6 +83,9 @@ private:
|
||||
bool fIsModified;
|
||||
};
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _RESOURCE_ITEM_H
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
#include <List.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
class ResourceItem;
|
||||
|
||||
@@ -70,6 +71,9 @@ private:
|
||||
bool fIsModified;
|
||||
};
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _RESOURCES_CONTAINER_H
|
||||
|
||||
|
||||
|
||||
@@ -103,3 +103,5 @@ const uint32 kResourceInfoTableEndSize = 8;
|
||||
|
||||
|
||||
#endif // _DEF_RESOURCES_H
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ typedef struct entry_ref;
|
||||
/*! Encompasses the functions used internally by the Storage Kit to
|
||||
interface with the kernel, as well as various internal support functions,
|
||||
data types, and type aliases. */
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// Type aliases
|
||||
typedef dirent DirEntry;
|
||||
@@ -63,7 +64,7 @@ status_t stat_dev(dev_t dev, fs_info* info);
|
||||
new file descriptor if successful, -1 otherwise. This version
|
||||
fails if the given file does not exist, or if you specify
|
||||
O_CREAT as one of the flags (use the four argument version
|
||||
of StorageKit::open() if you wish to create the file when
|
||||
of BPrivate::Storage::open() if you wish to create the file when
|
||||
it doesn't already exist). */
|
||||
status_t open(const char *path, OpenFlags flags, FileDescriptor &result);
|
||||
|
||||
@@ -190,13 +191,13 @@ status_t rewind_dir(FileDescriptor dir);
|
||||
/*! Iterates through the given directory searching for an entry whose name
|
||||
matches that given by name. On success, places the DirEntry in result
|
||||
and returns B_OK. On failures, returns an error code and sets result to
|
||||
StorageKit::NullDir.
|
||||
BPrivate::Storage::NullDir.
|
||||
|
||||
<b>Note:</b> This call modifies the internal position marker of dir. */
|
||||
status_t find_dir(FileDescriptor dir, const char *name, DirEntry *result,
|
||||
size_t length);
|
||||
|
||||
/*! Calls the other version of StorageKit::find_dir() and stores the results
|
||||
/*! Calls the other version of BPrivate::Storage::find_dir() and stores the results
|
||||
in the given entry_ref. */
|
||||
status_t find_dir(FileDescriptor dir, const char *name, entry_ref *result);
|
||||
|
||||
@@ -328,7 +329,9 @@ status_t rename(const char *oldPath, const char *newPath);
|
||||
/*! Removes path from the filesystem. */
|
||||
status_t remove(const char *path);
|
||||
|
||||
|
||||
} // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _STORAGE_KIT_KERNEL_INTERFACE_H
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
class BPositionIO;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
//! Abstract class defining methods acting on a list of ORed patterns
|
||||
@@ -26,6 +28,10 @@ protected:
|
||||
bool fCaseInsensitive;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_DISJ_LIST_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_DISJ_LIST_H
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <SupportDefs.h>
|
||||
#include <string>
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
//! Exception class used by the MIME Sniffer
|
||||
@@ -47,6 +49,10 @@ private:
|
||||
ssize_t fPos;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_ERR_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_ERR_H
|
||||
@@ -20,6 +20,8 @@
|
||||
class BString;
|
||||
|
||||
//! MIME Sniffer related classes
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class Rule;
|
||||
@@ -323,8 +325,12 @@ private:
|
||||
Err *fOutOfMemErr;
|
||||
};
|
||||
|
||||
} // namespace Sniffer
|
||||
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_PARSER_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
class BPositionIO;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class Err;
|
||||
@@ -46,6 +48,10 @@ private:
|
||||
Err *fErrorMessage;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_PATTERN_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_PATTERN_H
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
class BPositionIO;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class Err;
|
||||
@@ -38,6 +40,10 @@ private:
|
||||
Range fRange;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_PATTERN_LIST_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_PATTERN_LIST_H
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
class BPositionIO;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class Err;
|
||||
@@ -33,6 +35,10 @@ private:
|
||||
Pattern *fPattern;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_R_PATTERN_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_R_PATTERN_H
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
class BPositionIO;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class Err;
|
||||
@@ -34,6 +36,10 @@ private:
|
||||
std::vector<RPattern*> fList;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_R_PATTERN_LIST_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_R_PATTERN_LIST_H
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class Err;
|
||||
@@ -33,6 +35,10 @@ private:
|
||||
status_t fCStatus;
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_RANGE_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_RANGE_H
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
class BPositionIO;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Sniffer {
|
||||
|
||||
class DisjList;
|
||||
@@ -40,6 +42,10 @@ private:
|
||||
std::vector<DisjList*> *fConjList; // A list of DisjLists to be ANDed
|
||||
};
|
||||
|
||||
}
|
||||
}; // namespace Sniffer
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _SNIFFER_RULE_H
|
||||
|
||||
|
||||
#endif // _SNIFFER_RULE_H
|
||||
@@ -12,7 +12,8 @@
|
||||
#define _STORAGE_SUPPORT_H
|
||||
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
//! Returns whether the supplied path is absolute.
|
||||
bool is_absolute_path(const char *path);
|
||||
@@ -37,6 +38,9 @@ status_t check_entry_name(const char *entry);
|
||||
//! Checks whether a path name is a valid path name.
|
||||
status_t check_path_name(const char *path);
|
||||
|
||||
} // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
#endif // _STORAGE_SUPPORT_H
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenBeOS {
|
||||
BDirectory::BDirectory()
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ BDirectory::BDirectory()
|
||||
BDirectory::BDirectory(const BDirectory &dir)
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
*this = dir;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ BDirectory::BDirectory(const BDirectory &dir)
|
||||
BDirectory::BDirectory(const entry_ref *ref)
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
SetTo(ref);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ BDirectory::BDirectory(const entry_ref *ref)
|
||||
BDirectory::BDirectory(const node_ref *nref)
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
SetTo(nref);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ BDirectory::BDirectory(const node_ref *nref)
|
||||
BDirectory::BDirectory(const BEntry *entry)
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
SetTo(entry);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ BDirectory::BDirectory(const BEntry *entry)
|
||||
BDirectory::BDirectory(const char *path)
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
SetTo(path);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ BDirectory::BDirectory(const char *path)
|
||||
BDirectory::BDirectory(const BDirectory *dir, const char *path)
|
||||
: BNode(),
|
||||
BEntryList(),
|
||||
fDirFd(StorageKit::NullFd)
|
||||
fDirFd(BPrivate::Storage::NullFd)
|
||||
{
|
||||
SetTo(dir, path);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ BDirectory::~BDirectory()
|
||||
- \c B_BUSY: A node was busy.
|
||||
- \c B_FILE_ERROR: A general file error.
|
||||
- \c B_NO_MORE_FDS: The application has run out of file descriptors.
|
||||
\todo Currently implemented using StorageKit::entry_ref_to_path().
|
||||
\todo Currently implemented using BPrivate::Storage::entry_ref_to_path().
|
||||
Reimplement!
|
||||
*/
|
||||
status_t
|
||||
@@ -149,7 +149,7 @@ BDirectory::SetTo(const entry_ref *ref)
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
status_t error = (ref ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
error = StorageKit::entry_ref_to_path(ref, path,
|
||||
error = BPrivate::Storage::entry_ref_to_path(ref, path,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
}
|
||||
if (error == B_OK)
|
||||
@@ -241,24 +241,24 @@ BDirectory::SetTo(const char *path)
|
||||
{
|
||||
Unset();
|
||||
status_t result = (path ? B_OK : B_BAD_VALUE);
|
||||
StorageKit::FileDescriptor newDirFd = StorageKit::NullFd;
|
||||
BPrivate::Storage::FileDescriptor newDirFd = BPrivate::Storage::NullFd;
|
||||
if (result == B_OK)
|
||||
result = StorageKit::open_dir(path, newDirFd);
|
||||
result = BPrivate::Storage::open_dir(path, newDirFd);
|
||||
if (result == B_OK) {
|
||||
// We have to take care that BNode doesn't stick to a symbolic link.
|
||||
// open_dir() does always traverse those. Therefore we open the FD for
|
||||
// BNode (without the O_NOTRAVERSE flag).
|
||||
StorageKit::FileDescriptor fd = StorageKit::NullFd;
|
||||
result = StorageKit::open(path, O_RDWR, fd);
|
||||
BPrivate::Storage::FileDescriptor fd = BPrivate::Storage::NullFd;
|
||||
result = BPrivate::Storage::open(path, O_RDWR, fd);
|
||||
if (result == B_OK) {
|
||||
result = set_fd(fd);
|
||||
if (result != B_OK)
|
||||
StorageKit::close(fd);
|
||||
BPrivate::Storage::close(fd);
|
||||
}
|
||||
if (result == B_OK)
|
||||
fDirFd = newDirFd;
|
||||
else
|
||||
StorageKit::close_dir(newDirFd);
|
||||
BPrivate::Storage::close_dir(newDirFd);
|
||||
}
|
||||
// finally set the BNode status
|
||||
set_status(result);
|
||||
@@ -290,7 +290,7 @@ BDirectory::SetTo(const BDirectory *dir, const char *path)
|
||||
{
|
||||
Unset();
|
||||
status_t error = (dir && path ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK && StorageKit::is_absolute_path(path))
|
||||
if (error == B_OK && BPrivate::Storage::is_absolute_path(path))
|
||||
error = B_BAD_VALUE;
|
||||
BEntry entry;
|
||||
if (error == B_OK)
|
||||
@@ -316,7 +316,7 @@ BDirectory::SetTo(const BDirectory *dir, const char *path)
|
||||
- \c B_BUSY: A node was busy.
|
||||
- \c B_FILE_ERROR: A general file error.
|
||||
- \c B_NO_MORE_FDS: The application has run out of file descriptors.
|
||||
\todo Implemented using StorageKit::dir_to_self_entry_ref(). Check, if
|
||||
\todo Implemented using BPrivate::Storage::dir_to_self_entry_ref(). Check, if
|
||||
there is a better alternative.
|
||||
*/
|
||||
status_t
|
||||
@@ -329,7 +329,7 @@ BDirectory::GetEntry(BEntry *entry) const
|
||||
error = B_NO_INIT;
|
||||
entry_ref ref;
|
||||
if (error == B_OK)
|
||||
error = StorageKit::dir_to_self_entry_ref(fDirFd, &ref);
|
||||
error = BPrivate::Storage::dir_to_self_entry_ref(fDirFd, &ref);
|
||||
if (error == B_OK)
|
||||
error = entry->SetTo(&ref);
|
||||
return error;
|
||||
@@ -431,7 +431,7 @@ BDirectory::Contains(const char *path, int32 nodeFlags) const
|
||||
bool result = true;
|
||||
if (path) {
|
||||
BEntry entry;
|
||||
if (InitCheck() == B_OK && !StorageKit::is_absolute_path(path))
|
||||
if (InitCheck() == B_OK && !BPrivate::Storage::is_absolute_path(path))
|
||||
entry.SetTo(this, path);
|
||||
else
|
||||
entry.SetTo(path);
|
||||
@@ -490,13 +490,13 @@ BDirectory::Contains(const BEntry *entry, int32 nodeFlags) const
|
||||
if (result && InitCheck() == B_OK) {
|
||||
char dirPath[B_PATH_NAME_LENGTH + 1];
|
||||
char entryPath[B_PATH_NAME_LENGTH + 1];
|
||||
result = (StorageKit::dir_to_path(fDirFd, dirPath,
|
||||
result = (BPrivate::Storage::dir_to_path(fDirFd, dirPath,
|
||||
B_PATH_NAME_LENGTH + 1) == B_OK);
|
||||
entry_ref ref;
|
||||
if (result)
|
||||
result = (entry->GetRef(&ref) == B_OK);
|
||||
if (result) {
|
||||
result = (StorageKit::entry_ref_to_path(&ref, entryPath,
|
||||
result = (BPrivate::Storage::entry_ref_to_path(&ref, entryPath,
|
||||
B_PATH_NAME_LENGTH + 1)
|
||||
== B_OK);
|
||||
}
|
||||
@@ -606,10 +606,10 @@ BDirectory::GetNextRef(entry_ref *ref)
|
||||
if (error == B_OK && InitCheck() != B_OK)
|
||||
error = B_FILE_ERROR;
|
||||
if (error == B_OK) {
|
||||
StorageKit::LongDirEntry entry;
|
||||
BPrivate::Storage::LongDirEntry entry;
|
||||
bool next = true;
|
||||
while (error == B_OK && next) {
|
||||
if (StorageKit::read_dir(fDirFd, &entry, sizeof(entry), 1) != 1)
|
||||
if (BPrivate::Storage::read_dir(fDirFd, &entry, sizeof(entry), 1) != 1)
|
||||
error = B_ENTRY_NOT_FOUND;
|
||||
if (error == B_OK) {
|
||||
next = (!strcmp(entry.d_name, ".")
|
||||
@@ -650,7 +650,7 @@ BDirectory::GetNextDirents(dirent *buf, size_t bufSize, int32 count)
|
||||
if (result == B_OK && InitCheck() != B_OK)
|
||||
result = B_FILE_ERROR;
|
||||
if (result == B_OK)
|
||||
result = StorageKit::read_dir(fDirFd, buf, bufSize, count);
|
||||
result = BPrivate::Storage::read_dir(fDirFd, buf, bufSize, count);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ BDirectory::Rewind()
|
||||
if (error == B_OK && InitCheck() != B_OK)
|
||||
error = B_FILE_ERROR;
|
||||
if (error == B_OK)
|
||||
error = StorageKit::rewind_dir(fDirFd);
|
||||
error = BPrivate::Storage::rewind_dir(fDirFd);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -698,9 +698,9 @@ BDirectory::CountEntries()
|
||||
status_t error = Rewind();
|
||||
int32 count = 0;
|
||||
if (error == B_OK) {
|
||||
StorageKit::LongDirEntry entry;
|
||||
BPrivate::Storage::LongDirEntry entry;
|
||||
while (error == B_OK) {
|
||||
if (StorageKit::read_dir(fDirFd, &entry, sizeof(entry), 1) != 1)
|
||||
if (BPrivate::Storage::read_dir(fDirFd, &entry, sizeof(entry), 1) != 1)
|
||||
error = B_ENTRY_NOT_FOUND;
|
||||
if (error == B_OK
|
||||
&& strcmp(entry.d_name, ".") && strcmp(entry.d_name, "..")) {
|
||||
@@ -740,7 +740,7 @@ BDirectory::CreateDirectory(const char *path, BDirectory *dir)
|
||||
if (error == B_OK) {
|
||||
// get the actual (absolute) path using BEntry's help
|
||||
BEntry entry;
|
||||
if (InitCheck() == B_OK && !StorageKit::is_absolute_path(path))
|
||||
if (InitCheck() == B_OK && !BPrivate::Storage::is_absolute_path(path))
|
||||
entry.SetTo(this, path);
|
||||
else
|
||||
entry.SetTo(path);
|
||||
@@ -749,7 +749,7 @@ BDirectory::CreateDirectory(const char *path, BDirectory *dir)
|
||||
if (error == B_OK)
|
||||
error = entry.GetPath(&realPath);
|
||||
if (error == B_OK)
|
||||
error = StorageKit::create_dir(realPath.Path());
|
||||
error = BPrivate::Storage::create_dir(realPath.Path());
|
||||
if (error == B_OK && dir)
|
||||
error = dir->SetTo(realPath.Path());
|
||||
}
|
||||
@@ -793,7 +793,7 @@ BDirectory::CreateFile(const char *path, BFile *file, bool failIfExists)
|
||||
| (failIfExists ? B_FAIL_IF_EXISTS : 0);
|
||||
BFile tmpFile;
|
||||
BFile *realFile = (file ? file : &tmpFile);
|
||||
if (InitCheck() == B_OK && !StorageKit::is_absolute_path(path))
|
||||
if (InitCheck() == B_OK && !BPrivate::Storage::is_absolute_path(path))
|
||||
error = realFile->SetTo(this, path, openMode);
|
||||
else
|
||||
error = realFile->SetTo(path, openMode);
|
||||
@@ -831,7 +831,7 @@ BDirectory::CreateSymLink(const char *path, const char *linkToPath,
|
||||
if (error == B_OK) {
|
||||
// get the actual (absolute) path using BEntry's help
|
||||
BEntry entry;
|
||||
if (InitCheck() == B_OK && !StorageKit::is_absolute_path(path))
|
||||
if (InitCheck() == B_OK && !BPrivate::Storage::is_absolute_path(path))
|
||||
entry.SetTo(this, path);
|
||||
else
|
||||
entry.SetTo(path);
|
||||
@@ -840,7 +840,7 @@ BDirectory::CreateSymLink(const char *path, const char *linkToPath,
|
||||
if (error == B_OK)
|
||||
error = entry.GetPath(&realPath);
|
||||
if (error == B_OK)
|
||||
error = StorageKit::create_link(realPath.Path(), linkToPath);
|
||||
error = BPrivate::Storage::create_link(realPath.Path(), linkToPath);
|
||||
if (error == B_OK && link)
|
||||
error = link->SetTo(realPath.Path());
|
||||
}
|
||||
@@ -863,7 +863,7 @@ BDirectory::operator=(const BDirectory &dir)
|
||||
*((BNode*)this) = dir;
|
||||
if (InitCheck() == B_OK) {
|
||||
// duplicate the file descriptor
|
||||
status_t status = StorageKit::dup_dir(dir.fDirFd, fDirFd);
|
||||
status_t status = BPrivate::Storage::dup_dir(dir.fDirFd, fDirFd);
|
||||
if (status != B_OK)
|
||||
Unset();
|
||||
set_status(status);
|
||||
@@ -887,9 +887,9 @@ void BDirectory::_ReservedDirectory6() {}
|
||||
void
|
||||
BDirectory::close_fd()
|
||||
{
|
||||
if (fDirFd != StorageKit::NullFd) {
|
||||
StorageKit::close_dir(fDirFd);
|
||||
fDirFd = StorageKit::NullFd;
|
||||
if (fDirFd != BPrivate::Storage::NullFd) {
|
||||
BPrivate::Storage::close_dir(fDirFd);
|
||||
fDirFd = BPrivate::Storage::NullFd;
|
||||
}
|
||||
BNode::close_fd();
|
||||
}
|
||||
@@ -899,7 +899,7 @@ BDirectory::close_fd()
|
||||
directly.
|
||||
\return the file descriptor, or -1, if not properly initialized.
|
||||
*/
|
||||
StorageKit::FileDescriptor
|
||||
BPrivate::Storage::FileDescriptor
|
||||
BDirectory::get_fd() const
|
||||
{
|
||||
return fDirFd;
|
||||
@@ -943,7 +943,7 @@ create_directory(const char *path, mode_t mode)
|
||||
int32 nextComponent;
|
||||
do {
|
||||
// get the next path component
|
||||
error = StorageKit::parse_first_path_component(path, component,
|
||||
error = BPrivate::Storage::parse_first_path_component(path, component,
|
||||
nextComponent);
|
||||
if (error == B_OK) {
|
||||
// append it to the BPath
|
||||
@@ -964,7 +964,7 @@ create_directory(const char *path, mode_t mode)
|
||||
if (!entry.IsDirectory()) // but is no directory
|
||||
error = B_NOT_A_DIRECTORY;
|
||||
} else // it doesn't exists -- create it
|
||||
error = StorageKit::create_dir(dirPath.Path(), mode);
|
||||
error = BPrivate::Storage::create_dir(dirPath.Path(), mode);
|
||||
}
|
||||
}
|
||||
} while (error == B_OK && nextComponent != 0);
|
||||
@@ -976,3 +976,6 @@ create_directory(const char *path, mode_t mode)
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}; // namespace OpenBeOS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
+48
-45
@@ -218,7 +218,7 @@ entry_ref::operator=(const entry_ref &ref)
|
||||
- operator=(const BEntry&)
|
||||
*/
|
||||
BEntry::BEntry()
|
||||
: fDirFd(StorageKit::NullFd),
|
||||
: fDirFd(BPrivate::Storage::NullFd),
|
||||
fName(NULL),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
@@ -235,7 +235,7 @@ BEntry::BEntry()
|
||||
|
||||
*/
|
||||
BEntry::BEntry(const BDirectory *dir, const char *path, bool traverse)
|
||||
: fDirFd(StorageKit::NullFd),
|
||||
: fDirFd(BPrivate::Storage::NullFd),
|
||||
fName(NULL),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
@@ -253,7 +253,7 @@ BEntry::BEntry(const BDirectory *dir, const char *path, bool traverse)
|
||||
*/
|
||||
|
||||
BEntry::BEntry(const entry_ref *ref, bool traverse)
|
||||
: fDirFd(StorageKit::NullFd),
|
||||
: fDirFd(BPrivate::Storage::NullFd),
|
||||
fName(NULL),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
@@ -272,7 +272,7 @@ BEntry::BEntry(const entry_ref *ref, bool traverse)
|
||||
|
||||
*/
|
||||
BEntry::BEntry(const char *path, bool traverse)
|
||||
: fDirFd(StorageKit::NullFd),
|
||||
: fDirFd(BPrivate::Storage::NullFd),
|
||||
fName(NULL),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
@@ -284,7 +284,7 @@ BEntry::BEntry(const char *path, bool traverse)
|
||||
\see operator=(const BEntry&)
|
||||
*/
|
||||
BEntry::BEntry(const BEntry &entry)
|
||||
: fDirFd(StorageKit::NullFd),
|
||||
: fDirFd(BPrivate::Storage::NullFd),
|
||||
fName(NULL),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
@@ -323,8 +323,8 @@ BEntry::Exists() const
|
||||
return false;
|
||||
|
||||
// Attempt to find the entry in our current directory
|
||||
StorageKit::LongDirEntry entry;
|
||||
return StorageKit::find_dir(fDirFd, fName, &entry, sizeof(entry)) == B_OK;
|
||||
BPrivate::Storage::LongDirEntry entry;
|
||||
return BPrivate::Storage::find_dir(fDirFd, fName, &entry, sizeof(entry)) == B_OK;
|
||||
}
|
||||
|
||||
/*! \brief Fills in a stat structure for the entry. The information is copied into
|
||||
@@ -349,7 +349,7 @@ BEntry::GetStat(struct stat *result) const
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
return StorageKit::get_stat(ref, result);
|
||||
return BPrivate::Storage::get_stat(ref, result);
|
||||
}
|
||||
|
||||
/*! \brief Reinitializes the BEntry to the path or directory path combination,
|
||||
@@ -371,7 +371,7 @@ BEntry::SetTo(const BDirectory *dir, const char *path, bool traverse)
|
||||
return (fCStatus = B_BAD_VALUE);
|
||||
|
||||
fCStatus = B_OK;
|
||||
if (StorageKit::is_absolute_path(path)) {
|
||||
if (BPrivate::Storage::is_absolute_path(path)) {
|
||||
SetTo(path, traverse);
|
||||
} else {
|
||||
if (dir->InitCheck() != B_OK)
|
||||
@@ -379,7 +379,7 @@ BEntry::SetTo(const BDirectory *dir, const char *path, bool traverse)
|
||||
// get the dir's path
|
||||
char rootPath[B_PATH_NAME_LENGTH + 1];
|
||||
if (fCStatus == B_OK) {
|
||||
fCStatus = StorageKit::dir_to_path(dir->get_fd(), rootPath,
|
||||
fCStatus = BPrivate::Storage::dir_to_path(dir->get_fd(), rootPath,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
}
|
||||
// Concatenate our two path strings together
|
||||
@@ -418,7 +418,7 @@ BEntry::SetTo(const entry_ref *ref, bool traverse)
|
||||
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
|
||||
fCStatus = StorageKit::entry_ref_to_path(ref, path,
|
||||
fCStatus = BPrivate::Storage::entry_ref_to_path(ref, path,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
return (fCStatus == B_OK) ? SetTo(path, traverse) : fCStatus ;
|
||||
}
|
||||
@@ -438,20 +438,20 @@ BEntry::SetTo(const char *path, bool traverse)
|
||||
// check the argument
|
||||
fCStatus = (path ? B_OK : B_BAD_VALUE);
|
||||
if (fCStatus == B_OK)
|
||||
fCStatus = StorageKit::check_path_name(path);
|
||||
fCStatus = BPrivate::Storage::check_path_name(path);
|
||||
if (fCStatus == B_OK) {
|
||||
// Get the path and leaf portions of the given path
|
||||
char *pathStr, *leafStr;
|
||||
pathStr = leafStr = NULL;
|
||||
fCStatus = StorageKit::split_path(path, pathStr, leafStr);
|
||||
fCStatus = BPrivate::Storage::split_path(path, pathStr, leafStr);
|
||||
if (fCStatus == B_OK) {
|
||||
// Open the directory
|
||||
StorageKit::FileDescriptor dirFd;
|
||||
fCStatus = StorageKit::open_dir(pathStr, dirFd);
|
||||
BPrivate::Storage::FileDescriptor dirFd;
|
||||
fCStatus = BPrivate::Storage::open_dir(pathStr, dirFd);
|
||||
if (fCStatus == B_OK) {
|
||||
fCStatus = set(dirFd, leafStr, traverse);
|
||||
if (fCStatus != B_OK)
|
||||
StorageKit::close_dir(dirFd);
|
||||
BPrivate::Storage::close_dir(dirFd);
|
||||
}
|
||||
}
|
||||
delete [] pathStr;
|
||||
@@ -465,8 +465,8 @@ void
|
||||
BEntry::Unset()
|
||||
{
|
||||
// Close the directory
|
||||
if (fDirFd != StorageKit::NullFd) {
|
||||
StorageKit::close_dir(fDirFd);
|
||||
if (fDirFd != BPrivate::Storage::NullFd) {
|
||||
BPrivate::Storage::close_dir(fDirFd);
|
||||
}
|
||||
|
||||
// Free our leaf name
|
||||
@@ -474,7 +474,7 @@ BEntry::Unset()
|
||||
delete [] fName;
|
||||
}
|
||||
|
||||
fDirFd = StorageKit::NullFd;
|
||||
fDirFd = BPrivate::Storage::NullFd;
|
||||
fName = NULL;
|
||||
fCStatus = B_NO_INIT;
|
||||
}
|
||||
@@ -497,7 +497,7 @@ BEntry::GetRef(entry_ref *ref) const
|
||||
return B_BAD_VALUE;
|
||||
|
||||
struct stat st;
|
||||
status_t error = StorageKit::get_stat(fDirFd, &st);
|
||||
status_t error = BPrivate::Storage::get_stat(fDirFd, &st);
|
||||
if (error == B_OK) {
|
||||
ref->device = st.st_dev;
|
||||
ref->directory = st.st_ino;
|
||||
@@ -588,7 +588,7 @@ status_t BEntry::GetParent(BEntry *entry) const
|
||||
if (status == B_OK) {
|
||||
|
||||
// Verify we aren't an entry representing "/"
|
||||
status = StorageKit::entry_ref_is_root_dir(ref) ? B_ENTRY_NOT_FOUND
|
||||
status = BPrivate::Storage::entry_ref_is_root_dir(ref) ? B_ENTRY_NOT_FOUND
|
||||
: B_OK ;
|
||||
if (status == B_OK) {
|
||||
|
||||
@@ -635,7 +635,7 @@ BEntry::GetParent(BDirectory *dir) const
|
||||
if (status == B_OK) {
|
||||
|
||||
// Verify we aren't an entry representing "/"
|
||||
status = StorageKit::entry_ref_is_root_dir(ref) ? B_ENTRY_NOT_FOUND : B_OK ;
|
||||
status = BPrivate::Storage::entry_ref_is_root_dir(ref) ? B_ENTRY_NOT_FOUND : B_OK ;
|
||||
if (status == B_OK) {
|
||||
|
||||
// Now point the entry_ref to the parent directory (instead of ourselves)
|
||||
@@ -709,9 +709,9 @@ BEntry::Rename(const char *path, bool clobber)
|
||||
status_t status = B_OK;
|
||||
// Convert the given path to an absolute path, if it isn't already.
|
||||
char fullPath[B_PATH_NAME_LENGTH + 1];
|
||||
if (!StorageKit::is_absolute_path(path)) {
|
||||
if (!BPrivate::Storage::is_absolute_path(path)) {
|
||||
// Convert our directory to an absolute pathname
|
||||
status = StorageKit::dir_to_path(fDirFd, fullPath,
|
||||
status = BPrivate::Storage::dir_to_path(fDirFd, fullPath,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
if (status == B_OK) {
|
||||
// Concatenate our pathname to it
|
||||
@@ -724,8 +724,8 @@ BEntry::Rename(const char *path, bool clobber)
|
||||
if (status == B_OK && !clobber) {
|
||||
// We're not supposed to kill an already-existing file,
|
||||
// so we'll try to figure out if it exists by stat()ing it.
|
||||
StorageKit::Stat s;
|
||||
status = StorageKit::get_stat(path, &s);
|
||||
BPrivate::Storage::Stat s;
|
||||
status = BPrivate::Storage::get_stat(path, &s);
|
||||
if (status == B_OK)
|
||||
status = B_FILE_EXISTS;
|
||||
else if (status == B_ENTRY_NOT_FOUND)
|
||||
@@ -736,7 +736,7 @@ BEntry::Rename(const char *path, bool clobber)
|
||||
BPath oldPath;
|
||||
status = GetPath(&oldPath);
|
||||
if (status == B_OK) {
|
||||
status = StorageKit::rename(oldPath.Path(), path);
|
||||
status = BPrivate::Storage::rename(oldPath.Path(), path);
|
||||
if (status == B_OK)
|
||||
status = SetTo(path, false);
|
||||
}
|
||||
@@ -779,10 +779,10 @@ BEntry::MoveTo(BDirectory *dir, const char *path = NULL, bool clobber)
|
||||
|
||||
status_t status = B_OK;
|
||||
// Determine the absolute path of the target entry.
|
||||
if (!StorageKit::is_absolute_path(path)) {
|
||||
if (!BPrivate::Storage::is_absolute_path(path)) {
|
||||
// Convert our directory to an absolute pathname
|
||||
char fullPath[B_PATH_NAME_LENGTH + 1];
|
||||
status = StorageKit::dir_to_path(dir->get_fd(), fullPath,
|
||||
status = BPrivate::Storage::dir_to_path(dir->get_fd(), fullPath,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
// Concatenate our pathname to it
|
||||
if (status == B_OK) {
|
||||
@@ -822,7 +822,7 @@ BEntry::Remove()
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
return StorageKit::remove(path.Path());
|
||||
return BPrivate::Storage::remove(path.Path());
|
||||
}
|
||||
|
||||
|
||||
@@ -885,7 +885,7 @@ BEntry::operator=(const BEntry &item)
|
||||
|
||||
Unset();
|
||||
if (item.fCStatus == B_OK) {
|
||||
fCStatus = StorageKit::dup_dir(item.fDirFd, fDirFd);
|
||||
fCStatus = BPrivate::Storage::dup_dir(item.fDirFd, fDirFd);
|
||||
if (fCStatus == B_OK) {
|
||||
fCStatus = set_name(item.fName);
|
||||
}
|
||||
@@ -922,7 +922,7 @@ BEntry::set_stat(struct stat &st, uint32 what)
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
return StorageKit::set_stat(path.Path(), st, what);
|
||||
return BPrivate::Storage::set_stat(path.Path(), st, what);
|
||||
}
|
||||
|
||||
/*! Sets the Entry to point to the entry named by \c leaf in the given directory. If \c traverse
|
||||
@@ -932,7 +932,7 @@ BEntry::set_stat(struct stat &st, uint32 what)
|
||||
\c leaf <b>must</b> be a leaf-name only (i.e. it must contain no '/' characters),
|
||||
otherwise this function will return \c B_BAD_VALUE. If \c B_OK is returned,
|
||||
the caller is no longer responsible for closing the directory file descriptor
|
||||
with a call to StorageKit::close_dir.
|
||||
with a call to BPrivate::Storage::close_dir.
|
||||
|
||||
\param dirFd File descriptor of the directory in which the entry resides
|
||||
\param leaf Pointer to a string containing the entry's leaf name
|
||||
@@ -944,16 +944,16 @@ BEntry::set_stat(struct stat &st, uint32 what)
|
||||
|
||||
*/
|
||||
status_t
|
||||
BEntry::set(StorageKit::FileDescriptor dirFd, const char *leaf, bool traverse)
|
||||
BEntry::set(BPrivate::Storage::FileDescriptor dirFd, const char *leaf, bool traverse)
|
||||
{
|
||||
// Verify that path is valid
|
||||
status_t error = StorageKit::check_entry_name(leaf);
|
||||
status_t error = BPrivate::Storage::check_entry_name(leaf);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
// Check whether the entry is abstract or concrete.
|
||||
// We try traversing concrete entries only.
|
||||
StorageKit::LongDirEntry dirEntry;
|
||||
bool isConcrete = (StorageKit::find_dir(dirFd, leaf, &dirEntry,
|
||||
BPrivate::Storage::LongDirEntry dirEntry;
|
||||
bool isConcrete = (BPrivate::Storage::find_dir(dirFd, leaf, &dirEntry,
|
||||
sizeof(dirEntry)) == B_OK);
|
||||
if (traverse && isConcrete) {
|
||||
// Though the link traversing strategy is iterative, we introduce
|
||||
@@ -964,10 +964,10 @@ BEntry::set(StorageKit::FileDescriptor dirFd, const char *leaf, bool traverse)
|
||||
|
||||
// convert the dir FD into a BPath
|
||||
entry_ref ref;
|
||||
error = StorageKit::dir_to_self_entry_ref(dirFd, &ref);
|
||||
error = BPrivate::Storage::dir_to_self_entry_ref(dirFd, &ref);
|
||||
char dirPathname[B_PATH_NAME_LENGTH + 1];
|
||||
if (error == B_OK) {
|
||||
error = StorageKit::entry_ref_to_path(&ref, dirPathname,
|
||||
error = BPrivate::Storage::entry_ref_to_path(&ref, dirPathname,
|
||||
sizeof(dirPathname));
|
||||
}
|
||||
BPath dirPath(dirPathname);
|
||||
@@ -1006,13 +1006,13 @@ BEntry::set(StorageKit::FileDescriptor dirFd, const char *leaf, bool traverse)
|
||||
if (isLink)
|
||||
error = B_LINK_LIMIT;
|
||||
else {
|
||||
StorageKit::FileDescriptor newDirFd = StorageKit::NullFd;
|
||||
error = StorageKit::open_dir(dirPath.Path(), newDirFd);
|
||||
BPrivate::Storage::FileDescriptor newDirFd = BPrivate::Storage::NullFd;
|
||||
error = BPrivate::Storage::open_dir(dirPath.Path(), newDirFd);
|
||||
if (error == B_OK) {
|
||||
// If we are successful, we are responsible for the
|
||||
// supplied FD. Thus we close it.
|
||||
StorageKit::close_dir(dirFd);
|
||||
dirFd = StorageKit::NullFd;
|
||||
BPrivate::Storage::close_dir(dirFd);
|
||||
dirFd = BPrivate::Storage::NullFd;
|
||||
fDirFd = newDirFd;
|
||||
// handle "/", which has a "" Leaf()
|
||||
if (linkPath == "/")
|
||||
@@ -1076,9 +1076,9 @@ BEntry::Dump(const char *name)
|
||||
|
||||
printf("fCStatus == %ld\n", fCStatus);
|
||||
|
||||
StorageKit::LongDirEntry entry;
|
||||
BPrivate::Storage::LongDirEntry entry;
|
||||
if (fDirFd != -1
|
||||
&& StorageKit::find_dir(fDirFd, ".", &entry, sizeof(entry)) == B_OK) {
|
||||
&& BPrivate::Storage::find_dir(fDirFd, ".", &entry, sizeof(entry)) == B_OK) {
|
||||
printf("dir.device == %ld\n", entry.d_pdev);
|
||||
printf("dir.inode == %lld\n", entry.d_pino);
|
||||
} else {
|
||||
@@ -1134,3 +1134,6 @@ operator<(const entry_ref & a, const entry_ref & b)
|
||||
&& strcmp(a.name, b.name) < 0))))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -105,3 +105,6 @@ void BEntryList::_ReservedEntryList6() {}
|
||||
void BEntryList::_ReservedEntryList7() {}
|
||||
void BEntryList::_ReservedEntryList8() {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+20
-17
@@ -143,7 +143,7 @@ BFile::~BFile()
|
||||
- \c B_BUSY: A node was busy.
|
||||
- \c B_FILE_ERROR: A general file error.
|
||||
- \c B_NO_MORE_FDS: The application has run out of file descriptors.
|
||||
\todo Currently implemented using StorageKit::entry_ref_to_path().
|
||||
\todo Currently implemented using BPrivate::Storage::entry_ref_to_path().
|
||||
Reimplement!
|
||||
*/
|
||||
status_t
|
||||
@@ -153,7 +153,7 @@ BFile::SetTo(const entry_ref *ref, uint32 openMode)
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
status_t error = (ref ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
error = StorageKit::entry_ref_to_path(ref, path,
|
||||
error = BPrivate::Storage::entry_ref_to_path(ref, path,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
}
|
||||
if (error == B_OK)
|
||||
@@ -217,12 +217,12 @@ BFile::SetTo(const char *path, uint32 openMode)
|
||||
{
|
||||
Unset();
|
||||
status_t result = B_OK;
|
||||
StorageKit::FileDescriptor newFd = StorageKit::NullFd;
|
||||
BPrivate::Storage::FileDescriptor newFd = BPrivate::Storage::NullFd;
|
||||
if (path) {
|
||||
// analyze openMode
|
||||
// Well, it's a bit schizophrenic to convert the B_* style openMode
|
||||
// to POSIX style openFlags, but to use O_RWMASK to filter openMode.
|
||||
StorageKit::OpenFlags openFlags;
|
||||
BPrivate::Storage::OpenFlags openFlags;
|
||||
switch (openMode & O_RWMASK) {
|
||||
case B_READ_ONLY:
|
||||
openFlags = O_RDONLY;
|
||||
@@ -246,10 +246,10 @@ BFile::SetTo(const char *path, uint32 openMode)
|
||||
openFlags |= O_CREAT;
|
||||
if (openMode & B_FAIL_IF_EXISTS)
|
||||
openFlags |= O_EXCL;
|
||||
result = StorageKit::open(path, openFlags, S_IREAD | S_IWRITE,
|
||||
result = BPrivate::Storage::open(path, openFlags, S_IREAD | S_IWRITE,
|
||||
newFd);
|
||||
} else
|
||||
result = StorageKit::open(path, openFlags, newFd);
|
||||
result = BPrivate::Storage::open(path, openFlags, newFd);
|
||||
if (result == B_OK)
|
||||
fMode = openFlags;
|
||||
}
|
||||
@@ -259,7 +259,7 @@ BFile::SetTo(const char *path, uint32 openMode)
|
||||
if (result == B_OK) {
|
||||
result = set_fd(newFd);
|
||||
if (result != B_OK)
|
||||
StorageKit::close(newFd);
|
||||
BPrivate::Storage::close(newFd);
|
||||
}
|
||||
// finally set the BNode status
|
||||
set_status(result);
|
||||
@@ -342,7 +342,7 @@ BFile::Read(void *buffer, size_t size)
|
||||
{
|
||||
ssize_t result = InitCheck();
|
||||
if (result == B_OK)
|
||||
result = StorageKit::read(get_fd(), buffer, size);
|
||||
result = BPrivate::Storage::read(get_fd(), buffer, size);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ BFile::ReadAt(off_t location, void *buffer, size_t size)
|
||||
{
|
||||
ssize_t result = InitCheck();
|
||||
if (result == B_OK)
|
||||
result = StorageKit::read(get_fd(), buffer, location, size);
|
||||
result = BPrivate::Storage::read(get_fd(), buffer, location, size);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ BFile::Write(const void *buffer, size_t size)
|
||||
{
|
||||
ssize_t result = InitCheck();
|
||||
if (result == B_OK)
|
||||
result = StorageKit::write(get_fd(), buffer, size);
|
||||
result = BPrivate::Storage::write(get_fd(), buffer, size);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ BFile::WriteAt(off_t location, const void *buffer, size_t size)
|
||||
{
|
||||
ssize_t result = InitCheck();
|
||||
if (result == B_OK)
|
||||
result = StorageKit::write(get_fd(), buffer, location, size);
|
||||
result = BPrivate::Storage::write(get_fd(), buffer, location, size);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ BFile::Seek(off_t offset, uint32 seekMode)
|
||||
{
|
||||
off_t result = (InitCheck() == B_OK ? B_OK : B_FILE_ERROR);
|
||||
if (result == B_OK)
|
||||
result = StorageKit::seek(get_fd(), offset, seekMode);
|
||||
result = BPrivate::Storage::seek(get_fd(), offset, seekMode);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ BFile::Position() const
|
||||
{
|
||||
off_t result = (InitCheck() == B_OK ? B_OK : B_FILE_ERROR);
|
||||
if (result == B_OK)
|
||||
result = StorageKit::get_position(get_fd());
|
||||
result = BPrivate::Storage::get_position(get_fd());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -481,15 +481,15 @@ BFile::operator=(const BFile &file)
|
||||
Unset();
|
||||
if (file.InitCheck() == B_OK) {
|
||||
// duplicate the file descriptor
|
||||
StorageKit::FileDescriptor fd = -1;
|
||||
status_t status = StorageKit::dup(file.get_fd(), fd);
|
||||
BPrivate::Storage::FileDescriptor fd = -1;
|
||||
status_t status = BPrivate::Storage::dup(file.get_fd(), fd);
|
||||
// set it
|
||||
if (status == B_OK) {
|
||||
status = set_fd(fd);
|
||||
if (status == B_OK)
|
||||
fMode = file.fMode;
|
||||
else
|
||||
StorageKit::close(fd);
|
||||
BPrivate::Storage::close(fd);
|
||||
}
|
||||
set_status(status);
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void BFile::_ReservedFile6() {}
|
||||
To be used instead of accessing the BNode's private \c fFd member directly.
|
||||
\return the file descriptor, or -1, if not properly initialized.
|
||||
*/
|
||||
StorageKit::FileDescriptor
|
||||
BPrivate::Storage::FileDescriptor
|
||||
BFile::get_fd() const
|
||||
{
|
||||
return fFd;
|
||||
@@ -523,3 +523,6 @@ BFile::get_fd() const
|
||||
}; // namespace OpenBeOS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -306,3 +306,6 @@ find_directory(directory_which which, BPath *path, bool createIt,
|
||||
}; // namespace OpenBeOS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,3 +42,6 @@ is_type_swapped_adapter(type_code type)
|
||||
return is_type_swapped(type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -76,3 +76,6 @@ get_device_icon(const char *dev, void *icon, int32 size)
|
||||
return NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1114,8 +1114,8 @@ BMimeType::SetSnifferRule(const char *rule)
|
||||
status_t
|
||||
BMimeType::CheckSnifferRule(const char *rule, BString *parseError)
|
||||
{
|
||||
Sniffer::Rule snifferRule;
|
||||
return Sniffer::parse(rule, &snifferRule, parseError);
|
||||
BPrivate::Storage::Sniffer::Rule snifferRule;
|
||||
return BPrivate::Storage::Sniffer::parse(rule, &snifferRule, parseError);
|
||||
}
|
||||
|
||||
// GuessMimeType
|
||||
@@ -1249,3 +1249,6 @@ toLower(const char *str, char *result) {
|
||||
result[i] = 0;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+46
-43
@@ -83,8 +83,8 @@ node_ref::operator=(const node_ref &ref)
|
||||
/*! \brief Creates an uninitialized BNode object
|
||||
*/
|
||||
BNode::BNode()
|
||||
: fFd(StorageKit::NullFd),
|
||||
fAttrFd(StorageKit::NullFd),
|
||||
: fFd(BPrivate::Storage::NullFd),
|
||||
fAttrFd(BPrivate::Storage::NullFd),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
}
|
||||
@@ -94,8 +94,8 @@ BNode::BNode()
|
||||
\param ref the entry_ref referring to the entry
|
||||
*/
|
||||
BNode::BNode(const entry_ref *ref)
|
||||
: fFd(StorageKit::NullFd),
|
||||
fAttrFd(StorageKit::NullFd),
|
||||
: fFd(BPrivate::Storage::NullFd),
|
||||
fAttrFd(BPrivate::Storage::NullFd),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
SetTo(ref);
|
||||
@@ -106,8 +106,8 @@ BNode::BNode(const entry_ref *ref)
|
||||
\param entry the BEntry representing the entry
|
||||
*/
|
||||
BNode::BNode(const BEntry *entry)
|
||||
: fFd(StorageKit::NullFd),
|
||||
fAttrFd(StorageKit::NullFd),
|
||||
: fFd(BPrivate::Storage::NullFd),
|
||||
fAttrFd(BPrivate::Storage::NullFd),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
SetTo(entry);
|
||||
@@ -118,8 +118,8 @@ BNode::BNode(const BEntry *entry)
|
||||
\param path the path referring to the entry
|
||||
*/
|
||||
BNode::BNode(const char *path)
|
||||
: fFd(StorageKit::NullFd),
|
||||
fAttrFd(StorageKit::NullFd),
|
||||
: fFd(BPrivate::Storage::NullFd),
|
||||
fAttrFd(BPrivate::Storage::NullFd),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
SetTo(path);
|
||||
@@ -132,8 +132,8 @@ BNode::BNode(const char *path)
|
||||
\param path the entry's path name relative to \a dir
|
||||
*/
|
||||
BNode::BNode(const BDirectory *dir, const char *path)
|
||||
: fFd(StorageKit::NullFd),
|
||||
fAttrFd(StorageKit::NullFd),
|
||||
: fFd(BPrivate::Storage::NullFd),
|
||||
fAttrFd(BPrivate::Storage::NullFd),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
SetTo(dir, path);
|
||||
@@ -143,8 +143,8 @@ BNode::BNode(const BDirectory *dir, const char *path)
|
||||
\param node the BNode to be copied
|
||||
*/
|
||||
BNode::BNode(const BNode &node)
|
||||
: fFd(StorageKit::NullFd),
|
||||
fAttrFd(StorageKit::NullFd),
|
||||
: fFd(BPrivate::Storage::NullFd),
|
||||
fAttrFd(BPrivate::Storage::NullFd),
|
||||
fCStatus(B_NO_INIT)
|
||||
{
|
||||
*this = node;
|
||||
@@ -179,7 +179,7 @@ BNode::InitCheck() const
|
||||
status_t
|
||||
BNode::GetStat(struct stat *st) const
|
||||
{
|
||||
return (fCStatus != B_OK) ? fCStatus : StorageKit::get_stat(fFd, st) ;
|
||||
return (fCStatus != B_OK) ? fCStatus : BPrivate::Storage::get_stat(fFd, st) ;
|
||||
}
|
||||
|
||||
/*! \brief Reinitializes the object to the specified entry_ref.
|
||||
@@ -189,7 +189,7 @@ BNode::GetStat(struct stat *st) const
|
||||
- \c B_BAD_VALUE: \c NULL \a ref.
|
||||
- \c B_ENTRY_NOT_FOUND: The entry could not be found.
|
||||
- \c B_BUSY: The entry is locked.
|
||||
\todo Currently implemented using StorageKit::entry_ref_to_path().
|
||||
\todo Currently implemented using BPrivate::Storage::entry_ref_to_path().
|
||||
Reimplement!
|
||||
*/
|
||||
status_t
|
||||
@@ -199,7 +199,7 @@ BNode::SetTo(const entry_ref *ref)
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
status_t error = (ref ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
error = StorageKit::entry_ref_to_path(ref, path,
|
||||
error = BPrivate::Storage::entry_ref_to_path(ref, path,
|
||||
B_PATH_NAME_LENGTH + 1);
|
||||
}
|
||||
if (error == B_OK)
|
||||
@@ -248,7 +248,7 @@ BNode::SetTo(const char *path)
|
||||
{
|
||||
Unset();
|
||||
if (path != NULL)
|
||||
fCStatus = StorageKit::open(path, O_RDWR | O_NOTRAVERSE, fFd);
|
||||
fCStatus = BPrivate::Storage::open(path, O_RDWR | O_NOTRAVERSE, fFd);
|
||||
return fCStatus;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ BNode::SetTo(const BDirectory *dir, const char *path)
|
||||
{
|
||||
Unset();
|
||||
status_t error = (dir && path ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK && StorageKit::is_absolute_path(path))
|
||||
if (error == B_OK && BPrivate::Storage::is_absolute_path(path))
|
||||
error = B_BAD_VALUE;
|
||||
BEntry entry;
|
||||
if (error == B_OK)
|
||||
@@ -308,8 +308,8 @@ BNode::Lock()
|
||||
|
||||
// We'll need to keep lock around if the kernel function
|
||||
// doesn't just work on file descriptors
|
||||
// StorageKit::FileLock lock;
|
||||
// return StorageKit::lock(fFd, StorageKit::READ_WRITE, &lock);
|
||||
// BPrivate::Storage::FileLock lock;
|
||||
// return BPrivate::Storage::lock(fFd, BPrivate::Storage::READ_WRITE, &lock);
|
||||
}
|
||||
|
||||
/*! \brief Unlocks the node.
|
||||
@@ -336,7 +336,7 @@ BNode::Unlock()
|
||||
status_t
|
||||
BNode::Sync()
|
||||
{
|
||||
return (fCStatus != B_OK) ? B_FILE_ERROR : StorageKit::sync(fFd) ;
|
||||
return (fCStatus != B_OK) ? B_FILE_ERROR : BPrivate::Storage::sync(fFd) ;
|
||||
}
|
||||
|
||||
/*! \brief Writes data from a buffer to an attribute.
|
||||
@@ -366,7 +366,7 @@ BNode::WriteAttr(const char *attr, type_code type, off_t offset,
|
||||
if (fCStatus != B_OK)
|
||||
return B_FILE_ERROR;
|
||||
else {
|
||||
ssize_t result = StorageKit::write_attr(fFd, attr, type, offset,
|
||||
ssize_t result = BPrivate::Storage::write_attr(fFd, attr, type, offset,
|
||||
buffer, len);
|
||||
return result;
|
||||
}
|
||||
@@ -394,7 +394,7 @@ BNode::ReadAttr(const char *attr, type_code type, off_t offset,
|
||||
if (fCStatus != B_OK)
|
||||
return B_FILE_ERROR;
|
||||
else {
|
||||
ssize_t result = StorageKit::read_attr(fFd, attr, type, offset, buffer,
|
||||
ssize_t result = BPrivate::Storage::read_attr(fFd, attr, type, offset, buffer,
|
||||
len);
|
||||
return result;
|
||||
}
|
||||
@@ -413,7 +413,7 @@ status_t
|
||||
BNode::RemoveAttr(const char *name)
|
||||
{
|
||||
return (fCStatus != B_OK) ? B_FILE_ERROR
|
||||
: StorageKit::remove_attr(fFd, name);
|
||||
: BPrivate::Storage::remove_attr(fFd, name);
|
||||
}
|
||||
|
||||
/*! \brief Moves the attribute given by \a oldname to \a newname.
|
||||
@@ -433,7 +433,7 @@ BNode::RenameAttr(const char *oldname, const char *newname)
|
||||
{
|
||||
if (fCStatus != B_OK)
|
||||
return B_FILE_ERROR;
|
||||
return StorageKit::rename_attr(fFd, oldname, newname);
|
||||
return BPrivate::Storage::rename_attr(fFd, oldname, newname);
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ status_t
|
||||
BNode::GetAttrInfo(const char *name, struct attr_info *info) const
|
||||
{
|
||||
return (fCStatus != B_OK) ? B_FILE_ERROR
|
||||
: StorageKit::stat_attr(fFd, name, info);
|
||||
: BPrivate::Storage::stat_attr(fFd, name, info);
|
||||
}
|
||||
|
||||
/*! \brief Returns the next attribute in the node's list of attributes.
|
||||
@@ -482,8 +482,8 @@ BNode::GetNextAttrName(char *buffer)
|
||||
if (InitAttrDir() != B_OK)
|
||||
return B_FILE_ERROR;
|
||||
|
||||
StorageKit::LongDirEntry entry;
|
||||
status_t error = StorageKit::read_attr_dir(fAttrFd, entry);
|
||||
BPrivate::Storage::LongDirEntry entry;
|
||||
status_t error = BPrivate::Storage::read_attr_dir(fAttrFd, entry);
|
||||
if (error == B_OK) {
|
||||
strncpy(buffer, entry.d_name, B_ATTR_NAME_LENGTH);
|
||||
return B_OK;
|
||||
@@ -502,7 +502,7 @@ BNode::RewindAttrs()
|
||||
{
|
||||
if (InitAttrDir() != B_OK)
|
||||
return B_FILE_ERROR;
|
||||
StorageKit::rewind_attr_dir(fAttrFd);
|
||||
BPrivate::Storage::rewind_attr_dir(fAttrFd);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -587,8 +587,8 @@ BNode::operator=(const BNode &node)
|
||||
Unset();
|
||||
// We have to manually dup the node, because R5::BNode::Dup()
|
||||
// is not declared to be const (which IMO is retarded).
|
||||
fFd = StorageKit::dup(node.fFd);
|
||||
fCStatus = (fFd == StorageKit::NullFd) ? B_NO_INIT : B_OK ;
|
||||
fFd = BPrivate::Storage::dup(node.fFd);
|
||||
fCStatus = (fFd == BPrivate::Storage::NullFd) ? B_NO_INIT : B_OK ;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ BNode::operator==(const BNode &node) const
|
||||
return true;
|
||||
if (fCStatus == B_OK && node.InitCheck() == B_OK) {
|
||||
// Check if they're identical
|
||||
StorageKit::Stat s1, s2;
|
||||
BPrivate::Storage::Stat s1, s2;
|
||||
if (GetStat(&s1) != B_OK)
|
||||
return false;
|
||||
if (node.GetStat(&s2) != B_OK)
|
||||
@@ -635,7 +635,7 @@ BNode::operator!=(const BNode &node) const
|
||||
int
|
||||
BNode::Dup()
|
||||
{
|
||||
return StorageKit::dup(fFd);
|
||||
return BPrivate::Storage::dup(fFd);
|
||||
}
|
||||
|
||||
|
||||
@@ -659,7 +659,7 @@ void BNode::_ReservedNode6() { }
|
||||
thereafter.
|
||||
*/
|
||||
status_t
|
||||
BNode::set_fd(StorageKit::FileDescriptor fd)
|
||||
BNode::set_fd(BPrivate::Storage::FileDescriptor fd)
|
||||
{
|
||||
if (fFd != -1)
|
||||
close_fd();
|
||||
@@ -670,20 +670,20 @@ BNode::set_fd(StorageKit::FileDescriptor fd)
|
||||
/*! \brief Closes the node's file descriptor(s).
|
||||
To be implemented by subclasses to close the file descriptor using the
|
||||
proper system call for the given file-type. This implementation calls
|
||||
StorageKit::close(fFd) and also StorageKit::close_attr_dir(fAttrDir)
|
||||
BPrivate::Storage::close(fFd) and also BPrivate::Storage::close_attr_dir(fAttrDir)
|
||||
if necessary.
|
||||
*/
|
||||
void
|
||||
BNode::close_fd()
|
||||
{
|
||||
if (fAttrFd != StorageKit::NullFd)
|
||||
if (fAttrFd != BPrivate::Storage::NullFd)
|
||||
{
|
||||
StorageKit::close_attr_dir(fAttrFd);
|
||||
fAttrFd = StorageKit::NullFd;
|
||||
BPrivate::Storage::close_attr_dir(fAttrFd);
|
||||
fAttrFd = BPrivate::Storage::NullFd;
|
||||
}
|
||||
if (fFd != StorageKit::NullFd) {
|
||||
if (fFd != BPrivate::Storage::NullFd) {
|
||||
close(fFd);
|
||||
fFd = StorageKit::NullFd;
|
||||
fFd = BPrivate::Storage::NullFd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ BNode::set_stat(struct stat &st, uint32 what)
|
||||
{
|
||||
if (fCStatus != B_OK)
|
||||
return B_FILE_ERROR;
|
||||
return StorageKit::set_stat(fFd, st, what);
|
||||
return BPrivate::Storage::set_stat(fFd, st, what);
|
||||
}
|
||||
|
||||
/*! \brief Verifies that the BNode has been properly initialized, and then
|
||||
@@ -722,8 +722,8 @@ BNode::set_stat(struct stat &st, uint32 what)
|
||||
status_t
|
||||
BNode::InitAttrDir()
|
||||
{
|
||||
if (fCStatus == B_OK && fAttrFd == StorageKit::NullFd)
|
||||
return StorageKit::open_attr_dir(fFd, fAttrFd);
|
||||
if (fCStatus == B_OK && fAttrFd == BPrivate::Storage::NullFd)
|
||||
return BPrivate::Storage::open_attr_dir(fFd, fAttrFd);
|
||||
return fCStatus;
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ BNode::InitAttrDir()
|
||||
|
||||
/*! \var BNode::fAttrFd
|
||||
This appears to be passed to the attribute directory functions
|
||||
like a StorageKit::Dir would be, but it's actually a file descriptor.
|
||||
like a BPrivate::Storage::Dir would be, but it's actually a file descriptor.
|
||||
Best I can figure, the R5 syscall for reading attributes must've
|
||||
just taken a file descriptor. Depending on what our kernel ends up
|
||||
providing, this may or may not be replaced with an Dir*
|
||||
@@ -742,3 +742,6 @@ BNode::InitAttrDir()
|
||||
/*! \var BNode::fCStatus
|
||||
The object's initialization status.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -505,3 +505,6 @@ BNodeInfo::BNodeInfo(const BNodeInfo &)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
#include "OffsetFile.h"
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// constructor
|
||||
OffsetFile::OffsetFile()
|
||||
@@ -166,6 +167,9 @@ OffsetFile::Offset() const
|
||||
return fOffset;
|
||||
}
|
||||
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
|
||||
|
||||
}; // namespace StorageKit
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ BPath::SetTo(const entry_ref *ref)
|
||||
status_t error = (ref ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
error = StorageKit::entry_ref_to_path(ref, path, sizeof(path));
|
||||
error = BPrivate::Storage::entry_ref_to_path(ref, path, sizeof(path));
|
||||
if (error == B_OK)
|
||||
error = set_path(path); // the path is already normalized
|
||||
}
|
||||
@@ -173,12 +173,12 @@ status_t
|
||||
BPath::SetTo(const char *path, const char *leaf, bool normalize)
|
||||
{
|
||||
status_t error = (path ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK && leaf && StorageKit::is_absolute_path(leaf))
|
||||
if (error == B_OK && leaf && BPrivate::Storage::is_absolute_path(leaf))
|
||||
error = B_BAD_VALUE;
|
||||
char newPath[B_PATH_NAME_LENGTH + 1];
|
||||
if (error == B_OK) {
|
||||
// we always normalize relative paths
|
||||
normalize |= !StorageKit::is_absolute_path(path);
|
||||
normalize |= !BPrivate::Storage::is_absolute_path(path);
|
||||
// build a new path from path and leaf
|
||||
// copy path first
|
||||
uint32 pathLen = strlen(path);
|
||||
@@ -213,7 +213,7 @@ BPath::SetTo(const char *path, const char *leaf, bool normalize)
|
||||
if (error == B_OK) {
|
||||
if (normalize) {
|
||||
char normalizedPath[B_PATH_NAME_LENGTH + 1];
|
||||
error = StorageKit::get_canonical_path(newPath, normalizedPath,
|
||||
error = BPrivate::Storage::get_canonical_path(newPath, normalizedPath,
|
||||
sizeof(normalizedPath));
|
||||
if (error == B_OK)
|
||||
error = set_path(normalizedPath);
|
||||
@@ -714,3 +714,6 @@ BPath::MustNormalize(const char *path)
|
||||
\var status_t BPath::fCStatus
|
||||
\brief The object's initialization status.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
#include "kernel_interface.h"
|
||||
#include "QueryPredicate.h"
|
||||
|
||||
using namespace StorageKit;
|
||||
using namespace BPrivate::Storage;
|
||||
|
||||
|
||||
enum {
|
||||
NOT_IMPLEMENTED = B_ERROR,
|
||||
@@ -598,8 +599,8 @@ BQuery::GetNextRef(entry_ref *ref)
|
||||
if (error == B_OK && !_HasFetched())
|
||||
error = B_FILE_ERROR;
|
||||
if (error == B_OK) {
|
||||
StorageKit::LongDirEntry entry;
|
||||
if (StorageKit::read_query(fQueryFd, &entry, sizeof(entry), 1) != 1)
|
||||
BPrivate::Storage::LongDirEntry entry;
|
||||
if (BPrivate::Storage::read_query(fQueryFd, &entry, sizeof(entry), 1) != 1)
|
||||
error = B_ENTRY_NOT_FOUND;
|
||||
if (error == B_OK)
|
||||
*ref = entry_ref(entry.d_pdev, entry.d_pino, entry.d_name);
|
||||
@@ -770,3 +771,6 @@ void BQuery::_ReservedQuery3() {}
|
||||
void BQuery::_ReservedQuery4() {}
|
||||
void BQuery::_ReservedQuery5() {}
|
||||
void BQuery::_ReservedQuery6() {}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// QueryNode
|
||||
|
||||
@@ -482,4 +483,8 @@ QueryStack::_GetSubTree(QueryNode *&rootNode)
|
||||
}
|
||||
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
#include "ResourcesDefs.h"
|
||||
//#include "Warnings.h"
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// ELF defs
|
||||
static const uint32 kMaxELFHeaderSize = sizeof(Elf32_Ehdr) + 32;
|
||||
@@ -1232,5 +1233,9 @@ ResourceFile::_MakeEmptyResourceFile()
|
||||
}
|
||||
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
#include <DataIO.h>
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// constructor
|
||||
ResourceItem::ResourceItem()
|
||||
@@ -187,5 +188,9 @@ ResourceItem::IsModified() const
|
||||
}
|
||||
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ BResourceStrings::SetStringFile(const entry_ref *ref)
|
||||
fFileRef = *ref;
|
||||
} else {
|
||||
char appPath[B_PATH_NAME_LENGTH + 1];
|
||||
error = StorageKit::get_app_path(appPath);
|
||||
error = BPrivate::Storage::get_app_path(appPath);
|
||||
if (error == B_OK)
|
||||
error = get_ref_for_path(appPath, &fileRef);
|
||||
}
|
||||
@@ -400,3 +400,6 @@ BResourceStrings::_string_id_hash::assign_string(const char *str,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "ResourceItem.h"
|
||||
#include "ResourcesContainer.h"
|
||||
|
||||
using namespace StorageKit;
|
||||
using namespace BPrivate::Storage;
|
||||
|
||||
enum {
|
||||
NOT_IMPLEMENTED = B_ERROR,
|
||||
@@ -846,3 +846,6 @@ void BResources::_ReservedResources6() {}
|
||||
void BResources::_ReservedResources7() {}
|
||||
void BResources::_ReservedResources8() {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
#include "ResourceItem.h"
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
// constructor
|
||||
ResourcesContainer::ResourcesContainer()
|
||||
@@ -207,5 +208,9 @@ ResourcesContainer::IsModified() const
|
||||
}
|
||||
|
||||
|
||||
}; // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -322,3 +322,6 @@ BStatable::GetVolume(BVolume *vol) const
|
||||
void BStatable::_OhSoStatable1() {}
|
||||
void BStatable::_OhSoStatable2() {}
|
||||
void BStatable::_OhSoStatable3() {}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ BSymLink::ReadLink(char *buf, size_t size)
|
||||
if (error == B_OK && InitCheck() != B_OK)
|
||||
error = B_FILE_ERROR;
|
||||
if (error == B_OK)
|
||||
error = StorageKit::read_link(get_fd(), buf, size);
|
||||
error = BPrivate::Storage::read_link(get_fd(), buf, size);
|
||||
return error;
|
||||
*/
|
||||
// WORKAROUND
|
||||
@@ -207,9 +207,9 @@ BSymLink::ReadLink(char *buf, size_t size)
|
||||
error = fSecretEntry->GetRef(&ref);
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
if (error == B_OK)
|
||||
error = StorageKit::entry_ref_to_path(&ref, path, sizeof(path));
|
||||
error = BPrivate::Storage::entry_ref_to_path(&ref, path, sizeof(path));
|
||||
if (error == B_OK)
|
||||
error = StorageKit::read_link(path, buf, size);
|
||||
error = BPrivate::Storage::read_link(path, buf, size);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ BSymLink::MakeLinkedPath(const BDirectory *dir, BPath *path)
|
||||
if (result == 0)
|
||||
result = ReadLink(contents, sizeof(contents));
|
||||
if (result >= 0) {
|
||||
if (StorageKit::is_absolute_path(contents))
|
||||
if (BPrivate::Storage::is_absolute_path(contents))
|
||||
result = path->SetTo(contents);
|
||||
else
|
||||
result = path->SetTo(dir, contents);
|
||||
@@ -286,7 +286,7 @@ BSymLink::IsAbsolute()
|
||||
char contents[B_PATH_NAME_LENGTH + 1];
|
||||
bool result = (ReadLink(contents, sizeof(contents)) >= 0);
|
||||
if (result)
|
||||
result = StorageKit::is_absolute_path(contents);
|
||||
result = BPrivate::Storage::is_absolute_path(contents);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ void BSymLink::_ReservedSymLink6() {}
|
||||
/*! To be used instead of accessing the BNode's private \c fFd member directly.
|
||||
\return the file descriptor, or -1, if not properly initialized.
|
||||
*/
|
||||
StorageKit::FileDescriptor
|
||||
BPrivate::Storage::FileDescriptor
|
||||
BSymLink::get_fd() const
|
||||
{
|
||||
return fFd;
|
||||
@@ -325,3 +325,6 @@ BSymLink::get_fd() const
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}; // namespace OpenBeOS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
+15
-12
@@ -126,7 +126,7 @@ BVolume::SetTo(
|
||||
// Call the kernel function that gets device information
|
||||
// in order to determine the device status:
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(dev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(dev, &fsInfo);
|
||||
|
||||
if (err != 0) {
|
||||
fCStatus = errno;
|
||||
@@ -189,7 +189,7 @@ BVolume::GetRootDirectory(
|
||||
// the device and root node values.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err != 0) {
|
||||
currentStatus = errno;
|
||||
@@ -226,7 +226,7 @@ BVolume::Capacity(void) const
|
||||
// and calculate the total storage capacity.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
totalBytes = fsInfo.block_size * fsInfo.total_blocks;
|
||||
@@ -255,7 +255,7 @@ BVolume::FreeBytes(void) const
|
||||
// and calculate the free storage available.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
remainingBytes = fsInfo.block_size * fsInfo.free_blocks;
|
||||
@@ -284,7 +284,7 @@ BVolume::GetName(
|
||||
// and copies the device name into the buffer.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err != 0) {
|
||||
currentStatus = errno;
|
||||
@@ -365,7 +365,7 @@ BVolume::IsRemovable(void) const
|
||||
// and determines whether or not the device is removable.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeIsRemovable = (fsInfo.flags & B_FS_IS_REMOVABLE);
|
||||
@@ -389,7 +389,7 @@ BVolume::IsReadOnly(void) const
|
||||
// and determines whether or not the device is read-only.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeIsReadOnly = (fsInfo.flags & B_FS_IS_READONLY);
|
||||
@@ -414,7 +414,7 @@ BVolume::IsPersistent(void) const
|
||||
// is persistent.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeIsPersistent = (fsInfo.flags & B_FS_IS_PERSISTENT);
|
||||
@@ -439,7 +439,7 @@ BVolume::IsShared(void) const
|
||||
// over a network.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeIsShared = (fsInfo.flags & B_FS_IS_SHARED);
|
||||
@@ -464,7 +464,7 @@ BVolume::KnowsMime(void) const
|
||||
// MIME types.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeKnowsMime = (fsInfo.flags & B_FS_HAS_MIME);
|
||||
@@ -490,7 +490,7 @@ BVolume::KnowsAttr(void) const
|
||||
// volume accept attributes.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeKnowsAttr = (fsInfo.flags & B_FS_HAS_ATTR);
|
||||
@@ -516,7 +516,7 @@ BVolume::KnowsQuery(void) const
|
||||
// respond to queries.
|
||||
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(fDev, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(fDev, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
volumeKnowsQuery = (fsInfo.flags & B_FS_HAS_QUERY);
|
||||
@@ -611,3 +611,6 @@ void BVolume::_TurnUpTheVolume8() {}
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ BVolumeRoster::GetBootVolume(BVolume* boot_vol)
|
||||
|
||||
if(deviceID >= 0) {
|
||||
fs_info fsInfo;
|
||||
int err = StorageKit::stat_dev(deviceID, &fsInfo);
|
||||
int err = BPrivate::Storage::stat_dev(deviceID, &fsInfo);
|
||||
|
||||
if (err == 0) {
|
||||
if(std::strcmp(fsInfo.device_name, kBootVolumeName) == 0) {
|
||||
@@ -180,3 +180,6 @@ BVolumeRoster::Messenger(void) const
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ struct LongDIR : DIR { char _buffer[B_FILE_NAME_LENGTH]; };
|
||||
/*! Returns information about the file system on the specified device. */
|
||||
|
||||
status_t
|
||||
StorageKit::stat_dev(dev_t dev, fs_info* info)
|
||||
BPrivate::Storage::stat_dev(dev_t dev, fs_info* info)
|
||||
{
|
||||
return fs_stat_dev(dev, info);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ StorageKit::stat_dev(dev_t dev, fs_info* info)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
status_t
|
||||
StorageKit::open( const char *path, OpenFlags flags, FileDescriptor &result )
|
||||
BPrivate::Storage::open( const char *path, OpenFlags flags, FileDescriptor &result )
|
||||
{
|
||||
if (path == NULL) {
|
||||
result = -1;
|
||||
@@ -70,7 +70,7 @@ StorageKit::open( const char *path, OpenFlags flags, FileDescriptor &result )
|
||||
/*! Same as the other version of open() except the file is created with the
|
||||
permissions given by creationFlags if it doesn't exist. */
|
||||
status_t
|
||||
StorageKit::open( const char *path, OpenFlags flags,
|
||||
BPrivate::Storage::open( const char *path, OpenFlags flags,
|
||||
CreationFlags creationFlags, FileDescriptor &result )
|
||||
{
|
||||
if (path == NULL) {
|
||||
@@ -84,7 +84,7 @@ StorageKit::open( const char *path, OpenFlags flags,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::close(StorageKit::FileDescriptor file)
|
||||
BPrivate::Storage::close(BPrivate::Storage::FileDescriptor file)
|
||||
{
|
||||
return (::close(file) == -1) ? errno : B_OK ;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ StorageKit::close(StorageKit::FileDescriptor file)
|
||||
\return the number of bytes actually read or an error code
|
||||
*/
|
||||
ssize_t
|
||||
StorageKit::read(StorageKit::FileDescriptor fd, void *buf, size_t len)
|
||||
BPrivate::Storage::read(BPrivate::Storage::FileDescriptor fd, void *buf, size_t len)
|
||||
{
|
||||
ssize_t result = (buf == NULL ? B_BAD_VALUE : B_OK);
|
||||
if (result == B_OK) {
|
||||
@@ -113,7 +113,7 @@ StorageKit::read(StorageKit::FileDescriptor fd, void *buf, size_t len)
|
||||
\return the number of bytes actually read or an error code
|
||||
*/
|
||||
ssize_t
|
||||
StorageKit::read(StorageKit::FileDescriptor fd, void *buf, off_t pos,
|
||||
BPrivate::Storage::read(BPrivate::Storage::FileDescriptor fd, void *buf, off_t pos,
|
||||
size_t len)
|
||||
{
|
||||
ssize_t result = (buf == NULL || pos < 0 ? B_BAD_VALUE : B_OK);
|
||||
@@ -131,7 +131,7 @@ StorageKit::read(StorageKit::FileDescriptor fd, void *buf, off_t pos,
|
||||
\return the number of bytes actually written or an error code
|
||||
*/
|
||||
ssize_t
|
||||
StorageKit::write(StorageKit::FileDescriptor fd, const void *buf, size_t len)
|
||||
BPrivate::Storage::write(BPrivate::Storage::FileDescriptor fd, const void *buf, size_t len)
|
||||
{
|
||||
ssize_t result = (buf == NULL ? B_BAD_VALUE : B_OK);
|
||||
if (result == B_OK) {
|
||||
@@ -149,7 +149,7 @@ StorageKit::write(StorageKit::FileDescriptor fd, const void *buf, size_t len)
|
||||
\return the number of bytes actually written or an error code
|
||||
*/
|
||||
ssize_t
|
||||
StorageKit::write(StorageKit::FileDescriptor fd, const void *buf, off_t pos,
|
||||
BPrivate::Storage::write(BPrivate::Storage::FileDescriptor fd, const void *buf, off_t pos,
|
||||
size_t len)
|
||||
{
|
||||
ssize_t result = (buf == NULL || pos < 0 ? B_BAD_VALUE : B_OK);
|
||||
@@ -169,8 +169,8 @@ StorageKit::write(StorageKit::FileDescriptor fd, const void *buf, off_t pos,
|
||||
beginning of the file, or an error code
|
||||
*/
|
||||
off_t
|
||||
StorageKit::seek(StorageKit::FileDescriptor fd, off_t pos,
|
||||
StorageKit::SeekMode mode)
|
||||
BPrivate::Storage::seek(BPrivate::Storage::FileDescriptor fd, off_t pos,
|
||||
BPrivate::Storage::SeekMode mode)
|
||||
{
|
||||
off_t result = ::lseek(fd, pos, mode);
|
||||
if (result == -1)
|
||||
@@ -183,7 +183,7 @@ StorageKit::seek(StorageKit::FileDescriptor fd, off_t pos,
|
||||
beginning of the file, or an error code
|
||||
*/
|
||||
off_t
|
||||
StorageKit::get_position(StorageKit::FileDescriptor fd)
|
||||
BPrivate::Storage::get_position(BPrivate::Storage::FileDescriptor fd)
|
||||
{
|
||||
off_t result = ::lseek(fd, 0, SEEK_CUR);
|
||||
if (result == -1)
|
||||
@@ -191,8 +191,8 @@ StorageKit::get_position(StorageKit::FileDescriptor fd)
|
||||
return result;
|
||||
}
|
||||
|
||||
StorageKit::FileDescriptor
|
||||
StorageKit::dup(StorageKit::FileDescriptor file)
|
||||
BPrivate::Storage::FileDescriptor
|
||||
BPrivate::Storage::dup(BPrivate::Storage::FileDescriptor file)
|
||||
{
|
||||
return ::dup(file);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ StorageKit::dup(StorageKit::FileDescriptor file)
|
||||
\return B_OK, if everything went fine, or an error code.
|
||||
*/
|
||||
status_t
|
||||
StorageKit::dup( FileDescriptor file, FileDescriptor& result )
|
||||
BPrivate::Storage::dup( FileDescriptor file, FileDescriptor& result )
|
||||
{
|
||||
status_t error = B_OK;
|
||||
if (file == -1)
|
||||
@@ -218,13 +218,13 @@ StorageKit::dup( FileDescriptor file, FileDescriptor& result )
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::sync( FileDescriptor file )
|
||||
BPrivate::Storage::sync( FileDescriptor file )
|
||||
{
|
||||
return (fsync(file) == -1) ? errno : B_OK ;
|
||||
}
|
||||
|
||||
//! /todo Get rid of DumpLock() at some point (it's only for debugging)
|
||||
void DumpLock(StorageKit::FileLock &lock)
|
||||
void DumpLock(BPrivate::Storage::FileLock &lock)
|
||||
{
|
||||
cout << endl;
|
||||
cout << "type == ";
|
||||
@@ -258,7 +258,7 @@ void DumpLock(StorageKit::FileLock &lock)
|
||||
// are unimplemented in BeOS R5. Thus locking we'll have to wait for the new
|
||||
// kernel. I believe this function would work if fcntl() worked correctly.
|
||||
status_t
|
||||
StorageKit::lock(FileDescriptor file, OpenFlags mode, FileLock *lock)
|
||||
BPrivate::Storage::lock(FileDescriptor file, OpenFlags mode, FileLock *lock)
|
||||
{
|
||||
return B_FILE_ERROR;
|
||||
/*
|
||||
@@ -307,7 +307,7 @@ StorageKit::lock(FileDescriptor file, OpenFlags mode, FileLock *lock)
|
||||
// are unimplemented in BeOS R5. Thus locking will have to wait for the new
|
||||
// kernel. I believe this function would work if fcntl() worked correctly.
|
||||
status_t
|
||||
StorageKit::unlock(FileDescriptor file, FileLock *lock)
|
||||
BPrivate::Storage::unlock(FileDescriptor file, FileLock *lock)
|
||||
{
|
||||
return B_FILE_ERROR;
|
||||
|
||||
@@ -322,7 +322,7 @@ StorageKit::unlock(FileDescriptor file, FileLock *lock)
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::get_stat(const char *path, Stat *s)
|
||||
BPrivate::Storage::get_stat(const char *path, Stat *s)
|
||||
{
|
||||
if (path == NULL || s == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -331,7 +331,7 @@ StorageKit::get_stat(const char *path, Stat *s)
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::get_stat(FileDescriptor file, Stat *s)
|
||||
BPrivate::Storage::get_stat(FileDescriptor file, Stat *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -340,17 +340,17 @@ StorageKit::get_stat(FileDescriptor file, Stat *s)
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::get_stat(entry_ref &ref, Stat *result)
|
||||
BPrivate::Storage::get_stat(entry_ref &ref, Stat *result)
|
||||
{
|
||||
char path[B_PATH_NAME_LENGTH + 1];
|
||||
status_t status;
|
||||
|
||||
status = StorageKit::entry_ref_to_path(&ref, path, B_PATH_NAME_LENGTH + 1);
|
||||
return (status != B_OK) ? status : StorageKit::get_stat(path, result);
|
||||
status = BPrivate::Storage::entry_ref_to_path(&ref, path, B_PATH_NAME_LENGTH + 1);
|
||||
return (status != B_OK) ? status : BPrivate::Storage::get_stat(path, result);
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::set_stat(FileDescriptor file, Stat &s, StatMember what)
|
||||
BPrivate::Storage::set_stat(FileDescriptor file, Stat &s, StatMember what)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -401,7 +401,7 @@ StorageKit::set_stat(FileDescriptor file, Stat &s, StatMember what)
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::set_stat(const char *file, Stat &s, StatMember what)
|
||||
BPrivate::Storage::set_stat(const char *file, Stat &s, StatMember what)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -479,7 +479,7 @@ StorageKit::set_stat(const char *file, Stat &s, StatMember what)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
ssize_t
|
||||
StorageKit::read_attr ( StorageKit::FileDescriptor file, const char *attribute,
|
||||
BPrivate::Storage::read_attr ( BPrivate::Storage::FileDescriptor file, const char *attribute,
|
||||
uint32 type, off_t pos, void *buf, size_t count )
|
||||
{
|
||||
if (attribute == NULL || buf == NULL)
|
||||
@@ -490,7 +490,7 @@ StorageKit::read_attr ( StorageKit::FileDescriptor file, const char *attribute,
|
||||
}
|
||||
|
||||
ssize_t
|
||||
StorageKit::write_attr ( StorageKit::FileDescriptor file,
|
||||
BPrivate::Storage::write_attr ( BPrivate::Storage::FileDescriptor file,
|
||||
const char *attribute, uint32 type, off_t pos,
|
||||
const void *buf, size_t count )
|
||||
{
|
||||
@@ -502,7 +502,7 @@ StorageKit::write_attr ( StorageKit::FileDescriptor file,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::rename_attr(FileDescriptor file, const char *oldName,
|
||||
BPrivate::Storage::rename_attr(FileDescriptor file, const char *oldName,
|
||||
const char *newName)
|
||||
{
|
||||
status_t error = (oldName && newName ? B_OK : B_BAD_VALUE);
|
||||
@@ -553,7 +553,7 @@ StorageKit::rename_attr(FileDescriptor file, const char *oldName,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::remove_attr ( StorageKit::FileDescriptor file, const char *attr )
|
||||
BPrivate::Storage::remove_attr ( BPrivate::Storage::FileDescriptor file, const char *attr )
|
||||
{
|
||||
if (attr == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -566,7 +566,7 @@ StorageKit::remove_attr ( StorageKit::FileDescriptor file, const char *attr )
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::stat_attr( FileDescriptor file, const char *name, AttrInfo *ai )
|
||||
BPrivate::Storage::stat_attr( FileDescriptor file, const char *name, AttrInfo *ai )
|
||||
{
|
||||
if (name == NULL || ai == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -580,7 +580,7 @@ StorageKit::stat_attr( FileDescriptor file, const char *name, AttrInfo *ai )
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
status_t
|
||||
StorageKit::open_attr_dir( FileDescriptor file, FileDescriptor &result )
|
||||
BPrivate::Storage::open_attr_dir( FileDescriptor file, FileDescriptor &result )
|
||||
{
|
||||
result = NullFd;
|
||||
if (DIR *dir = ::fs_fopen_attr_dir(file)) {
|
||||
@@ -591,7 +591,7 @@ StorageKit::open_attr_dir( FileDescriptor file, FileDescriptor &result )
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::rewind_attr_dir( FileDescriptor dir )
|
||||
BPrivate::Storage::rewind_attr_dir( FileDescriptor dir )
|
||||
{
|
||||
if (dir < 0)
|
||||
return B_BAD_VALUE;
|
||||
@@ -606,7 +606,7 @@ StorageKit::rewind_attr_dir( FileDescriptor dir )
|
||||
|
||||
// buffer must be large enough!!!
|
||||
status_t
|
||||
StorageKit::read_attr_dir( FileDescriptor dir, StorageKit::DirEntry& buffer )
|
||||
BPrivate::Storage::read_attr_dir( FileDescriptor dir, BPrivate::Storage::DirEntry& buffer )
|
||||
{
|
||||
// init a DIR structure
|
||||
LongDIR dirDir;
|
||||
@@ -629,9 +629,9 @@ StorageKit::read_attr_dir( FileDescriptor dir, StorageKit::DirEntry& buffer )
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::close_attr_dir ( FileDescriptor dir )
|
||||
BPrivate::Storage::close_attr_dir ( FileDescriptor dir )
|
||||
{
|
||||
if (dir == StorageKit::NullFd)
|
||||
if (dir == BPrivate::Storage::NullFd)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
// init a DIR structure
|
||||
@@ -648,7 +648,7 @@ StorageKit::close_attr_dir ( FileDescriptor dir )
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
status_t
|
||||
StorageKit::open_dir( const char *path, FileDescriptor &result )
|
||||
BPrivate::Storage::open_dir( const char *path, FileDescriptor &result )
|
||||
{
|
||||
result = NullFd;
|
||||
if (DIR *dir = ::opendir(path)) {
|
||||
@@ -664,7 +664,7 @@ StorageKit::open_dir( const char *path, FileDescriptor &result )
|
||||
\return B_OK, if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::create_dir( const char *path, mode_t mode )
|
||||
BPrivate::Storage::create_dir( const char *path, mode_t mode )
|
||||
{
|
||||
status_t error = (path ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
@@ -681,7 +681,7 @@ StorageKit::create_dir( const char *path, mode_t mode )
|
||||
\return B_OK, if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::create_dir( const char *path, FileDescriptor &result,
|
||||
BPrivate::Storage::create_dir( const char *path, FileDescriptor &result,
|
||||
mode_t mode )
|
||||
{
|
||||
status_t error = create_dir(path, mode);
|
||||
@@ -700,7 +700,7 @@ StorageKit::create_dir( const char *path, FileDescriptor &result,
|
||||
- \c B_BAD_VALUE, if \a buffer is NULL, or the supplied buffer is too small
|
||||
*/
|
||||
int32
|
||||
StorageKit::read_dir( FileDescriptor dir, DirEntry *buffer, size_t length,
|
||||
BPrivate::Storage::read_dir( FileDescriptor dir, DirEntry *buffer, size_t length,
|
||||
int32 count )
|
||||
{
|
||||
// init a DIR structure
|
||||
@@ -729,7 +729,7 @@ StorageKit::read_dir( FileDescriptor dir, DirEntry *buffer, size_t length,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::rewind_dir( FileDescriptor dir )
|
||||
BPrivate::Storage::rewind_dir( FileDescriptor dir )
|
||||
{
|
||||
if (dir < 0)
|
||||
return B_BAD_VALUE;
|
||||
@@ -743,7 +743,7 @@ StorageKit::rewind_dir( FileDescriptor dir )
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::find_dir( FileDescriptor dir, const char *name,
|
||||
BPrivate::Storage::find_dir( FileDescriptor dir, const char *name,
|
||||
DirEntry *result, size_t length )
|
||||
{
|
||||
if (dir < 0 || name == NULL || result == NULL)
|
||||
@@ -751,9 +751,9 @@ StorageKit::find_dir( FileDescriptor dir, const char *name,
|
||||
|
||||
status_t status;
|
||||
|
||||
status = StorageKit::rewind_dir(dir);
|
||||
status = BPrivate::Storage::rewind_dir(dir);
|
||||
if (status == B_OK) {
|
||||
while ( StorageKit::read_dir(dir, result, length, 1) == 1)
|
||||
while ( BPrivate::Storage::read_dir(dir, result, length, 1) == 1)
|
||||
{
|
||||
if (strcmp(result->d_name, name) == 0)
|
||||
return B_OK;
|
||||
@@ -765,12 +765,12 @@ StorageKit::find_dir( FileDescriptor dir, const char *name,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::find_dir( FileDescriptor dir, const char *name, entry_ref *result )
|
||||
BPrivate::Storage::find_dir( FileDescriptor dir, const char *name, entry_ref *result )
|
||||
{
|
||||
status_t status = (result ? B_OK : B_BAD_VALUE);
|
||||
LongDirEntry entry;
|
||||
if (status == B_OK)
|
||||
status = StorageKit::find_dir(dir, name, &entry, sizeof(entry));
|
||||
status = BPrivate::Storage::find_dir(dir, name, &entry, sizeof(entry));
|
||||
if (status == B_OK) {
|
||||
result->device = entry.d_pdev;
|
||||
result->directory = entry.d_pino;
|
||||
@@ -780,13 +780,13 @@ StorageKit::find_dir( FileDescriptor dir, const char *name, entry_ref *result )
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::dup_dir( FileDescriptor dir, FileDescriptor &result )
|
||||
BPrivate::Storage::dup_dir( FileDescriptor dir, FileDescriptor &result )
|
||||
{
|
||||
return StorageKit::dup(dir, result);
|
||||
return BPrivate::Storage::dup(dir, result);
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::close_dir( FileDescriptor dir )
|
||||
BPrivate::Storage::close_dir( FileDescriptor dir )
|
||||
{
|
||||
// init a DIR structure
|
||||
if (LongDIR* dirDir = (LongDIR*)malloc(sizeof(LongDIR))) {
|
||||
@@ -806,7 +806,7 @@ StorageKit::close_dir( FileDescriptor dir )
|
||||
\return B_OK, if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::create_link( const char *path, const char *linkToPath )
|
||||
BPrivate::Storage::create_link( const char *path, const char *linkToPath )
|
||||
{
|
||||
status_t error = (path && linkToPath ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
@@ -823,7 +823,7 @@ StorageKit::create_link( const char *path, const char *linkToPath )
|
||||
\return B_OK, if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::create_link( const char *path, const char *linkToPath,
|
||||
BPrivate::Storage::create_link( const char *path, const char *linkToPath,
|
||||
FileDescriptor &result)
|
||||
{
|
||||
status_t error = create_link(path, linkToPath);
|
||||
@@ -833,7 +833,7 @@ StorageKit::create_link( const char *path, const char *linkToPath,
|
||||
}
|
||||
|
||||
ssize_t
|
||||
StorageKit::read_link( const char *path, char *result, size_t size )
|
||||
BPrivate::Storage::read_link( const char *path, char *result, size_t size )
|
||||
{
|
||||
if (result == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -853,7 +853,7 @@ StorageKit::read_link( const char *path, char *result, size_t size )
|
||||
}
|
||||
|
||||
ssize_t
|
||||
StorageKit::read_link( FileDescriptor fd, char *result, size_t size )
|
||||
BPrivate::Storage::read_link( FileDescriptor fd, char *result, size_t size )
|
||||
{
|
||||
ssize_t error = (result ? B_OK : B_BAD_VALUE);
|
||||
// no way to implement it :-(
|
||||
@@ -868,7 +868,7 @@ StorageKit::read_link( FileDescriptor fd, char *result, size_t size )
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
status_t
|
||||
StorageKit::open_query( dev_t device, const char *query, uint32 flags,
|
||||
BPrivate::Storage::open_query( dev_t device, const char *query, uint32 flags,
|
||||
FileDescriptor &result )
|
||||
{
|
||||
if (flags & B_LIVE_QUERY)
|
||||
@@ -882,7 +882,7 @@ StorageKit::open_query( dev_t device, const char *query, uint32 flags,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::open_live_query( dev_t device, const char *query, uint32 flags,
|
||||
BPrivate::Storage::open_live_query( dev_t device, const char *query, uint32 flags,
|
||||
port_id port, int32 token,
|
||||
FileDescriptor &result )
|
||||
{
|
||||
@@ -906,7 +906,7 @@ StorageKit::open_live_query( dev_t device, const char *query, uint32 flags,
|
||||
- \c B_BAD_VALUE, if \a buffer is NULL, or the supplied buffer is too small
|
||||
*/
|
||||
int32
|
||||
StorageKit::read_query( FileDescriptor query, DirEntry *buffer, size_t length,
|
||||
BPrivate::Storage::read_query( FileDescriptor query, DirEntry *buffer, size_t length,
|
||||
int32 count )
|
||||
{
|
||||
// init a DIR structure
|
||||
@@ -935,7 +935,7 @@ StorageKit::read_query( FileDescriptor query, DirEntry *buffer, size_t length,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::close_query( FileDescriptor query )
|
||||
BPrivate::Storage::close_query( FileDescriptor query )
|
||||
{
|
||||
// init a DIR structure
|
||||
if (LongDIR* queryDir = (LongDIR*)malloc(sizeof(LongDIR))) {
|
||||
@@ -951,7 +951,7 @@ StorageKit::close_query( FileDescriptor query )
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
status_t
|
||||
StorageKit::entry_ref_to_path( const struct entry_ref *ref, char *result,
|
||||
BPrivate::Storage::entry_ref_to_path( const struct entry_ref *ref, char *result,
|
||||
size_t size )
|
||||
{
|
||||
if (ref == NULL) {
|
||||
@@ -963,22 +963,22 @@ StorageKit::entry_ref_to_path( const struct entry_ref *ref, char *result,
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::entry_ref_to_path( dev_t device, ino_t directory, const char *name,
|
||||
BPrivate::Storage::entry_ref_to_path( dev_t device, ino_t directory, const char *name,
|
||||
char *result, size_t size )
|
||||
{
|
||||
return entry_ref_to_path_adapter(device, directory, name, result, size);
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::dir_to_self_entry_ref( FileDescriptor dir, entry_ref *result )
|
||||
BPrivate::Storage::dir_to_self_entry_ref( FileDescriptor dir, entry_ref *result )
|
||||
{
|
||||
if (dir == StorageKit::NullFd || result == NULL)
|
||||
if (dir == BPrivate::Storage::NullFd || result == NULL)
|
||||
return B_BAD_VALUE;
|
||||
return find_dir(dir, ".", result);
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::dir_to_path( FileDescriptor dir, char *result, size_t size )
|
||||
BPrivate::Storage::dir_to_path( FileDescriptor dir, char *result, size_t size )
|
||||
{
|
||||
if (dir < 0 || result == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -1000,7 +1000,7 @@ StorageKit::dir_to_path( FileDescriptor dir, char *result, size_t size )
|
||||
\return \c B_OK if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::get_canonical_path(const char *path, char *result, size_t size)
|
||||
BPrivate::Storage::get_canonical_path(const char *path, char *result, size_t size)
|
||||
{
|
||||
status_t error = (path && result ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
@@ -1041,7 +1041,7 @@ StorageKit::get_canonical_path(const char *path, char *result, size_t size)
|
||||
\return \c B_OK if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::get_canonical_path(const char *path, char *&result)
|
||||
BPrivate::Storage::get_canonical_path(const char *path, char *&result)
|
||||
{
|
||||
status_t error = (path ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
@@ -1066,7 +1066,7 @@ StorageKit::get_canonical_path(const char *path, char *&result)
|
||||
\return \c B_OK if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::get_canonical_dir_path(const char *path, char *result, size_t size)
|
||||
BPrivate::Storage::get_canonical_dir_path(const char *path, char *result, size_t size)
|
||||
{
|
||||
status_t error = (path && result ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
@@ -1086,7 +1086,7 @@ StorageKit::get_canonical_dir_path(const char *path, char *result, size_t size)
|
||||
\return \c B_OK if everything went fine, an error code otherwise
|
||||
*/
|
||||
status_t
|
||||
StorageKit::get_canonical_dir_path(const char *path, char *&result)
|
||||
BPrivate::Storage::get_canonical_dir_path(const char *path, char *&result)
|
||||
{
|
||||
status_t error = (path ? B_OK : B_BAD_VALUE);
|
||||
if (error == B_OK) {
|
||||
@@ -1106,7 +1106,7 @@ StorageKit::get_canonical_dir_path(const char *path, char *&result)
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::get_app_path(char *buffer)
|
||||
BPrivate::Storage::get_app_path(char *buffer)
|
||||
{
|
||||
status_t error = (buffer ? B_OK : B_BAD_VALUE);
|
||||
image_info info;
|
||||
@@ -1127,14 +1127,14 @@ StorageKit::get_app_path(char *buffer)
|
||||
}
|
||||
|
||||
bool
|
||||
StorageKit::entry_ref_is_root_dir( entry_ref &ref )
|
||||
BPrivate::Storage::entry_ref_is_root_dir( entry_ref &ref )
|
||||
{
|
||||
return ref.directory == 1 && ref.device == 1 && ref.name[0] == '.'
|
||||
&& ref.name[1] == 0;
|
||||
}
|
||||
|
||||
status_t
|
||||
StorageKit::rename(const char *oldPath, const char *newPath)
|
||||
BPrivate::Storage::rename(const char *oldPath, const char *newPath)
|
||||
{
|
||||
if (oldPath == NULL || newPath == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -1144,7 +1144,7 @@ StorageKit::rename(const char *oldPath, const char *newPath)
|
||||
|
||||
/*! Removes path from the filesystem. */
|
||||
status_t
|
||||
StorageKit::remove(const char *path)
|
||||
BPrivate::Storage::remove(const char *path)
|
||||
{
|
||||
if (path == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -1152,3 +1152,6 @@ StorageKit::remove(const char *path)
|
||||
return (::remove(path) == -1) ? errno : B_OK ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <sniffer/DisjList.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
DisjList::DisjList()
|
||||
: fCaseInsensitive(false)
|
||||
@@ -29,3 +29,6 @@ DisjList::IsCaseInsensitive() {
|
||||
return fCaseInsensitive;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <sniffer/Err.h>
|
||||
#include <new.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Err
|
||||
@@ -92,3 +92,6 @@ void
|
||||
Err::SetPos(ssize_t pos) {
|
||||
fPos = pos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <string.h>
|
||||
#include <String.h> // BString
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
// Miscellaneous helper functions
|
||||
char escapeChar(char ch);
|
||||
@@ -37,7 +37,7 @@ bool isDecimalChar(char ch);
|
||||
bool isPunctuation(char ch);
|
||||
|
||||
//! Parses the given rule.
|
||||
/*! The resulting parsed Sniffer::Rule structure is stored in \c rule, which
|
||||
/*! The resulting parsed Rule structure is stored in \c rule, which
|
||||
must be pre-allocated. If parsing fails, a descriptive error message (meant
|
||||
to be viewed in a monospaced font) is placed in the pre-allocated \c BString
|
||||
pointed to by \c parseError (which may be \c NULL if you don't care about
|
||||
@@ -45,7 +45,7 @@ bool isPunctuation(char ch);
|
||||
|
||||
\param rule Pointer to a NULL-terminated string containing the sniffer
|
||||
rule to be parsed
|
||||
\param result Pointer to a pre-allocated \c Sniffer::Rule object into which the result
|
||||
\param result Pointer to a pre-allocated \c Rule object into which the result
|
||||
of parsing is placed upon success.
|
||||
\param parseError Point to pre-allocated \c BString object into which
|
||||
a descriptive error message is stored upon failure.
|
||||
@@ -55,7 +55,7 @@ bool isPunctuation(char ch);
|
||||
- B_BAD_MIME_SNIFFER_RULE: Failure
|
||||
*/
|
||||
status_t
|
||||
Sniffer::parse(const char *rule, Rule *result, BString *parseError) {
|
||||
BPrivate::Storage::Sniffer::parse(const char *rule, Rule *result, BString *parseError) {
|
||||
Parser parser;
|
||||
return parser.Parse(rule, result, parseError);
|
||||
}
|
||||
@@ -743,7 +743,7 @@ TokenStream::InitCheck() const {
|
||||
|
||||
//! Returns a pointer to the next token in the stream.
|
||||
/*! The TokenStream object retains owner ship of the Token object returned by Get().
|
||||
If Get() is called at the end of the stream, a pointer to a Sniffer::Err object is thrown.
|
||||
If Get() is called at the end of the stream, a pointer to a Err object is thrown.
|
||||
*/
|
||||
const Token*
|
||||
TokenStream::Get() {
|
||||
@@ -759,7 +759,7 @@ TokenStream::Get() {
|
||||
}
|
||||
|
||||
//! Places token returned by the most recent call to Get() back on the head of the stream.
|
||||
/*! If Unget() is called at the beginning of the stream, a pointer to a Sniffer::Err object is thrown.
|
||||
/*! If Unget() is called at the beginning of the stream, a pointer to a Err object is thrown.
|
||||
*/
|
||||
void
|
||||
TokenStream::Unget() {
|
||||
@@ -773,7 +773,7 @@ TokenStream::Unget() {
|
||||
|
||||
|
||||
/*! \brief Reads the next token in the stream and verifies it is of the given type,
|
||||
throwing a pointer to a Sniffer::Err object if it is not.
|
||||
throwing a pointer to a Err object if it is not.
|
||||
*/
|
||||
void
|
||||
TokenStream::Read(TokenType type) {
|
||||
@@ -954,7 +954,7 @@ isPunctuation(char ch) {
|
||||
}
|
||||
|
||||
const char*
|
||||
Sniffer::tokenTypeToString(TokenType type) {
|
||||
BPrivate::Storage::Sniffer::tokenTypeToString(TokenType type) {
|
||||
switch (type) {
|
||||
case LeftParen:
|
||||
return "LeftParen";
|
||||
@@ -1341,3 +1341,6 @@ Parser::ThrowUnexpectedTokenError(TokenType expected1, TokenType expected2, cons
|
||||
+ (found ? tokenTypeToString(found->Type()) : "NULL token")).c_str()
|
||||
, (found ? found->Pos() : stream.EndPos()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <DataIO.h>
|
||||
#include <stdio.h> // for SEEK_* defines
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
Pattern::Pattern(const std::string &string, const std::string &mask)
|
||||
: fCStatus(B_NO_INIT)
|
||||
@@ -160,3 +160,6 @@ Pattern::SetErrorMessage(const char *msg) {
|
||||
delete fErrorMessage;
|
||||
fErrorMessage = (msg) ? (new(nothrow) Err(msg, -1)) : (NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <DataIO.h>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
PatternList::PatternList(Range range)
|
||||
: DisjList()
|
||||
@@ -61,3 +61,6 @@ PatternList::Add(Pattern *pattern) {
|
||||
if (pattern)
|
||||
fList.push_back(pattern);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <sniffer/RPattern.h>
|
||||
#include <DataIO.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
RPattern::RPattern(Range range, Pattern *pattern)
|
||||
: fRange(range)
|
||||
@@ -59,3 +59,6 @@ RPattern::Sniff(BPositionIO *data, bool caseInsensitive) const {
|
||||
else
|
||||
return fPattern->Sniff(fRange, data, caseInsensitive);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <DataIO.h>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
RPatternList::RPatternList()
|
||||
: DisjList()
|
||||
@@ -61,3 +61,6 @@ RPatternList::Add(RPattern *rpattern) {
|
||||
if (rpattern)
|
||||
fList.push_back(rpattern);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <sniffer/Parser.h>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
Range::Range(int32 start, int32 end)
|
||||
: fStart(-1)
|
||||
@@ -60,3 +60,6 @@ Range::SetTo(int32 start, int32 end) {
|
||||
fCStatus = B_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <sniffer/Rule.h>
|
||||
#include <DataIO.h>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
Rule::Rule()
|
||||
: fPriority(0.0)
|
||||
@@ -72,3 +72,6 @@ Rule::SetTo(double priority, std::vector<DisjList*>* list) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <SupportDefs.h>
|
||||
#include "storage_support.h"
|
||||
|
||||
namespace StorageKit {
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
|
||||
/*! \param path the path
|
||||
\return \c true, if \a path is not \c NULL and absolute, \c false otherwise
|
||||
@@ -315,4 +316,8 @@ check_path_name(const char *path)
|
||||
}
|
||||
|
||||
|
||||
} // namespace StorageKit
|
||||
}; // namespace Storage
|
||||
}; // namespace BPrivate
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
using namespace Sniffer;
|
||||
using namespace BPrivate::Storage::Sniffer;
|
||||
|
||||
// Suite
|
||||
CppUnit::Test*
|
||||
|
||||
Reference in New Issue
Block a user