Cleaned up C++/C separation.

Changed some return types from "int" to "status_t" to make it compatible
with the new VFS interface (should not cause any trouble).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7818 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-06-07 22:41:37 +00:00
parent 49776e51ad
commit 371536a11d
4 changed files with 41 additions and 32 deletions

View File

@ -173,6 +173,10 @@ typedef long long bigtime_t;
typedef long thread_id;
typedef long status_t;
#ifdef __cplusplus
extern "C" {
#endif
sem_id create_sem(long count, const char *name);
long delete_sem(sem_id sem);
long acquire_sem(sem_id sem);
@ -189,9 +193,16 @@ ssize_t write_pos(int fd, fs_off_t _pos, const void *data, size_t nbytes);
ssize_t readv_pos(int fd, fs_off_t _pos, struct iovec *iov, int count);
ssize_t writev_pos(int fd, fs_off_t _pos, struct iovec *iov, int count);
#ifdef __cplusplus
}
#endif
#endif /* __BEOS__ */
#ifdef __cplusplus
extern "C" {
#endif
void panic(const char *msg, ...);
int device_is_read_only(const char *device);
int get_device_block_size(int fd);
@ -200,5 +211,8 @@ int device_is_removeable(int fd);
int lock_removeable_device(int fd, bool on_or_off);
void hexdump(void *address, int size);
#ifdef __cplusplus
}
#endif
#endif /* _COMPAT_H */

View File

@ -14,6 +14,7 @@
#include <iovec.h>
#include <OS.h>
#include <NodeMonitor.h>
#include <fs_attr.h>
#include <fs_info.h>
#include <BeBuild.h>
@ -37,20 +38,6 @@ typedef ino_t vnode_id;
#define WFSSTAT_NAME 0x0001
#define B_ENTRY_CREATED 1
#define B_ENTRY_REMOVED 2
#define B_ENTRY_MOVED 3
#define B_STAT_CHANGED 4
#define B_ATTR_CHANGED 5
#define B_DEVICE_MOUNTED 6
#define B_DEVICE_UNMOUNTED 7
#define B_STOP_WATCHING 0x0000
#define B_WATCH_NAME 0x0001
#define B_WATCH_STAT 0x0002
#define B_WATCH_ATTR 0x0004
#define B_WATCH_DIRECTORY 0x0008
#define SELECT_READ 1
#define SELECT_WRITE 2
#define SELECT_EXCEPTION 3
@ -239,25 +226,32 @@ typedef struct vnode_ops {
op_suspend_vnode (*suspend_vnode);
} vnode_ops;
#ifdef __cplusplus
extern "C" {
#endif
extern _IMPEXP_KERNEL int new_path(const char *path, char **copy);
extern _IMPEXP_KERNEL void free_path(char *p);
extern _IMPEXP_KERNEL int notify_listener(int op, nspace_id nsid,
extern _IMPEXP_KERNEL status_t notify_listener(int op, nspace_id nsid,
vnode_id vnida, vnode_id vnidb,
vnode_id vnidc, const char *name);
extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref);
extern _IMPEXP_KERNEL int send_notification(port_id port, long token,
extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref);
extern _IMPEXP_KERNEL status_t send_notification(port_id port, long token,
ulong what, long op, nspace_id nsida,
nspace_id nsidb, vnode_id vnida,
vnode_id vnidb, vnode_id vnidc,
const char *name);
extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, vnode_id vnid, void **data);
extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, vnode_id vnid, void *data);
extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL status_t get_vnode(nspace_id nsid, vnode_id vnid, void **data);
extern _IMPEXP_KERNEL status_t put_vnode(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL status_t new_vnode(nspace_id nsid, vnode_id vnid, void *data);
extern _IMPEXP_KERNEL status_t remove_vnode(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL status_t unremove_vnode(nspace_id nsid, vnode_id vnid);
extern _IMPEXP_KERNEL status_t is_vnode_removed(nspace_id nsid, vnode_id vnid);
#ifdef __cplusplus
}
#endif
extern _EXPORT vnode_ops fs_entry;
extern _EXPORT int32 api_version;

View File

@ -2329,7 +2329,7 @@ parse_path(vnode *bvn, char **pstart, char *path, int eatsymlink, vnode **vnp)
* get_vnode
*/
int
status_t
get_vnode(nspace_id nsid, vnode_id vnid, void **data)
{
int err;
@ -2347,7 +2347,7 @@ get_vnode(nspace_id nsid, vnode_id vnid, void **data)
* put_vnode
*/
int
status_t
put_vnode(nspace_id nsid, vnode_id vnid)
{
vnode *vn;
@ -2367,7 +2367,7 @@ put_vnode(nspace_id nsid, vnode_id vnid)
* new_vnode
*/
int
status_t
new_vnode(nspace_id nsid, vnode_id vnid, void *data)
{
// int retries = 20;
@ -2432,7 +2432,7 @@ restart:
* remove_vnode
*/
int
status_t
remove_vnode(nspace_id nsid, vnode_id vnid)
{
vnode *vn;
@ -2452,7 +2452,7 @@ remove_vnode(nspace_id nsid, vnode_id vnid)
* unremove_vnode
*/
int
status_t
unremove_vnode(nspace_id nsid, vnode_id vnid)
{
vnode *vn;
@ -2472,7 +2472,7 @@ unremove_vnode(nspace_id nsid, vnode_id vnid)
* is_vnode_removed
*/
int
status_t
is_vnode_removed(nspace_id nsid, vnode_id vnid)
{
vnode *vn;
@ -3315,7 +3315,7 @@ free_fds(fdarray *fds)
// dummies
int
status_t
notify_listener(int op, nspace_id nsid, vnode_id vnida, vnode_id vnidb, vnode_id vnidc, const char *name)
{
#ifdef DEBUG
@ -3330,7 +3330,7 @@ notify_listener(int op, nspace_id nsid, vnode_id vnida, vnode_id vnidb, vnode_id
}
int
status_t
send_notification(port_id port, long token, ulong what, long op, nspace_id nsida,
nspace_id nsidb, vnode_id vnida, vnode_id vnidb, vnode_id vnidc,
const char *name)

View File

@ -2,12 +2,13 @@
#define MYFS_H
#include "fsproto.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "compat.h"
#include "fsproto.h"
#include "lock.h"
#include "cache.h"