start of entry and storagedefs units

This commit is contained in:
ocoursiere
2003-05-19 23:17:26 +00:00
parent 9fbbb108dc
commit 1d36a2e4d9
2 changed files with 87 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
{ BePascal - A pascal wrapper around the BeOS API
Copyright (C) 2002 Olivier Coursiere
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
}
unit Entry;
interface
uses
beobj, StorageDefs;
type
TEntryRef = record
device : dev_t;
directory : ino_t;
name : PChar;
end;
implementation
end.

View File

@@ -0,0 +1,52 @@
unit StorageDefs;
interface
const
// from sys/param.h
NAME_MAX = 256;
// from limits.h
PATH_MAX = 1024;
MAXPATHLEN = PATH_MAX;
B_FILE_NAME_LENGTH = NAME_MAX;
B_PATH_NAME_LENGTH = MAXPATHLEN;
B_ATTR_NAME_LENGTH = B_FILE_NAME_LENGTH - 1;
B_MIME_TYPE_LENGTH = B_ATTR_NAME_LENGTH - 15;
// B_MAX_SYMLINKS = SYMLINK_MAX;
// from fcntl.h
O_RDONLY = 0;
O_WRONLY = 1;
O_RDWR = 2;
O_RWMASK = 3;
O_EXCL = $0100;
O_CREAT = $0200;
O_TRUNC = $0400;
O_APPEND = $0800;
// from StorageDefs.h
B_READ_ONLY = O_RDONLY;
B_WRITE_ONLY = O_WRONLY;
B_READ_WRITE = O_RDWR;
B_FAIL_IF_EXISTS = O_EXCL;
B_CREATE_FILE = O_CREAT;
B_ERASE_FILE = O_TRUNC;
B_OPEN_AT_END = O_APPEND;
// Node flavor
B_FILE_NODE = $01;
B_SYMLINK_NODE = $02;
B_DIRECTORY_NODE = $04;
B_ANY_NODE = $07;
type
// from types.h
dev_t = integer;
ino_t = int64;
implementation
end.