Remove unwanted code, backup, files named old (when same exist but without old), suo files are changed and created when windows project are opened
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31230 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
GroupProperties.o : \
|
||||
/boot/home/BeServed/source/BeManager/GroupProperties.cpp \
|
||||
/boot/develop/headers/be/app/Application.h \
|
||||
/boot/develop/headers/be/storage/Resources.h \
|
||||
/boot/develop/headers/be/interface/Window.h \
|
||||
/boot/develop/headers/be/interface/View.h \
|
||||
/boot/develop/headers/be/interface/Region.h \
|
||||
/boot/develop/headers/be/interface/Button.h \
|
||||
/boot/develop/headers/be/interface/CheckBox.h \
|
||||
/boot/develop/headers/be/interface/TextControl.h \
|
||||
/boot/develop/headers/be/interface/Bitmap.h \
|
||||
/boot/develop/headers/be/storage/Mime.h \
|
||||
/boot/develop/headers/be/storage/FilePanel.h \
|
||||
/boot/develop/headers/be/interface/Menu.h \
|
||||
/boot/develop/headers/be/interface/PopUpMenu.h \
|
||||
/boot/develop/headers/be/interface/MenuItem.h \
|
||||
/boot/develop/headers/be/interface/MenuField.h \
|
||||
/boot/develop/headers/be/support/String.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/ColumnListView.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/Colors.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/CLVColumn.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/PrefilledBitmap/PrefilledBitmap.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/BetterScrollView/BetterScrollView.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ScrollViewCorner/ScrollViewCorner.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/CLVListItem.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/CLVEasyItem.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/NewStrings/NewStrings.h \
|
||||
/boot/home/BeServed/source/BeManager/ListControl.h \
|
||||
/boot/home/BeServed/source/BeManager/PickUser.h \
|
||||
/boot/home/BeServed/source/BeManager/GroupProperties.h \
|
||||
/boot/home/BeServed/source/BeManager/Icons.h \
|
||||
/boot/home/BeServed/source/BeManager/besure_auth.h
|
||||
@@ -1,27 +0,0 @@
|
||||
Groups.o : /boot/home/BeServed/source/BeManager/Groups.cpp \
|
||||
/boot/develop/headers/be/app/Application.h \
|
||||
/boot/develop/headers/be/storage/Resources.h \
|
||||
/boot/develop/headers/be/interface/Window.h \
|
||||
/boot/develop/headers/be/interface/View.h \
|
||||
/boot/develop/headers/be/interface/Region.h \
|
||||
/boot/develop/headers/be/interface/Alert.h \
|
||||
/boot/develop/headers/be/interface/Button.h \
|
||||
/boot/develop/headers/be/storage/FindDirectory.h \
|
||||
/boot/develop/headers/be/storage/Mime.h \
|
||||
/boot/develop/headers/posix/string.h \
|
||||
/boot/develop/headers/posix/dirent.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/ColumnListView.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/Colors.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/CLVColumn.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/PrefilledBitmap/PrefilledBitmap.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/BetterScrollView/BetterScrollView.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ScrollViewCorner/ScrollViewCorner.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/CLVListItem.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/ColumnListView/CLVEasyItem.h \
|
||||
/boot/home/dev/Santas\ gift\ bag/NewStrings/NewStrings.h \
|
||||
/boot/home/BeServed/source/BeManager/TreeControl.h \
|
||||
/boot/home/BeServed/source/BeManager/ListControl.h \
|
||||
/boot/home/BeServed/source/BeManager/Groups.h \
|
||||
/boot/home/BeServed/source/BeManager/GroupProperties.h \
|
||||
/boot/home/BeServed/source/BeManager/Icons.h \
|
||||
/boot/home/BeServed/source/BeManager/besure_auth.h
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,206 +0,0 @@
|
||||
// File Sharing Preferences Application
|
||||
//
|
||||
// FileSharing.cpp
|
||||
//
|
||||
|
||||
// TODO:
|
||||
// 1. Make share properties panel modal but still work with file panel
|
||||
|
||||
#include "Application.h"
|
||||
#include "Window.h"
|
||||
#include "Alert.h"
|
||||
#include "CheckBox.h"
|
||||
#include "Button.h"
|
||||
#include "TextControl.h"
|
||||
#include "Menu.h"
|
||||
#include "MenuBar.h"
|
||||
#include "PopUpMenu.h"
|
||||
#include "MenuItem.h"
|
||||
#include "MenuField.h"
|
||||
#include "Point.h"
|
||||
#include "Mime.h"
|
||||
#include "Roster.h"
|
||||
#include "Resources.h"
|
||||
|
||||
#define MENU_BAR_HEIGHT 18.0
|
||||
|
||||
#define MSG_TEST_CANCEL 'TCan'
|
||||
#define MSG_FILE_NEW 'FNew'
|
||||
#define MSG_FILE_OPEN 'FOpn'
|
||||
#define MSG_FILE_SAVE 'FSav'
|
||||
|
||||
|
||||
class TestMenuItem : public BMenuItem
|
||||
{
|
||||
public:
|
||||
TestMenuItem(char *title, BMessage *msg)
|
||||
: BMenuItem(title, msg)
|
||||
{
|
||||
}
|
||||
|
||||
~TestMenuItem()
|
||||
{
|
||||
}
|
||||
|
||||
void DrawContent()
|
||||
{
|
||||
Highlight(IsSelected());
|
||||
}
|
||||
|
||||
void Highlight(bool flag)
|
||||
{
|
||||
rgb_color white = { 255, 255, 255, 255 };
|
||||
rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
rgb_color yellow = ui_color(B_WINDOW_TAB_COLOR);
|
||||
|
||||
BPoint point = ContentLocation();
|
||||
BMenu *menu = Menu();
|
||||
BRect frame = Frame();
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
frame.right = 18;
|
||||
menu->SetLowColor(gray);
|
||||
menu->FillRect(frame, B_SOLID_LOW);
|
||||
frame = Frame();
|
||||
frame.left = 18;
|
||||
}
|
||||
else
|
||||
{
|
||||
// menu->SetLowColor(darkYellow);
|
||||
// menu->StrokeRect(frame, B_SOLID_LOW);
|
||||
// frame.InsetBy(1, 1);
|
||||
}
|
||||
|
||||
menu->SetLowColor(flag ? yellow : white);
|
||||
menu->FillRect(frame, B_SOLID_LOW);
|
||||
menu->MovePenTo(point.x + 7, point.y + 10);
|
||||
menu->DrawString(Label());
|
||||
}
|
||||
};
|
||||
|
||||
// ----- TestView ---------------------------------------------------------------
|
||||
|
||||
class TestView : public BView
|
||||
{
|
||||
public:
|
||||
TestView(BRect rect)
|
||||
: BView(rect, "TestView", B_FOLLOW_BOTTOM | B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW)
|
||||
{
|
||||
rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
SetViewColor(gray);
|
||||
|
||||
BRect r;
|
||||
r.Set(337, 52, 412, 72);
|
||||
AddChild(new BButton(r, "CancelBtn", "Close", new BMessage(MSG_TEST_CANCEL), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM));
|
||||
}
|
||||
|
||||
~TestView()
|
||||
{
|
||||
}
|
||||
|
||||
void Draw(BRect rect)
|
||||
{
|
||||
BRect r = Bounds();
|
||||
rgb_color black = { 0, 0, 0, 255 };
|
||||
rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
|
||||
SetViewColor(gray);
|
||||
SetLowColor(gray);
|
||||
FillRect(r, B_SOLID_LOW);
|
||||
|
||||
SetHighColor(black);
|
||||
SetFont(be_plain_font);
|
||||
SetFontSize(10);
|
||||
MovePenTo(15, 15);
|
||||
DrawString("");
|
||||
}
|
||||
|
||||
private:
|
||||
BButton *deployBtn;
|
||||
};
|
||||
|
||||
// ----- TestWindow -------------------------------------------------------------------
|
||||
|
||||
class TestWindow : public BWindow
|
||||
{
|
||||
public:
|
||||
TestWindow()
|
||||
: BWindow(BRect(50, 50, 475, 460), "Menu Testing", B_TITLED_WINDOW, 0)
|
||||
{
|
||||
BRect r = Bounds();
|
||||
|
||||
r = Bounds();
|
||||
testView = new TestView(r);
|
||||
AddChild(testView);
|
||||
|
||||
r.bottom = MENU_BAR_HEIGHT;
|
||||
menuBar = new BMenuBar(r, "MenuBar");
|
||||
AddChild(menuBar);
|
||||
|
||||
BMenu *menu = new BMenu("File");
|
||||
menuBar->AddItem(menu);
|
||||
|
||||
menu->AddItem(new TestMenuItem("New", new BMessage(MSG_FILE_NEW)));
|
||||
menu->AddItem(new TestMenuItem("Open", new BMessage(MSG_FILE_OPEN)));
|
||||
menu->AddItem(new TestMenuItem("Save", new BMessage(MSG_FILE_SAVE)));
|
||||
|
||||
Show();
|
||||
}
|
||||
|
||||
// ~TestWindow()
|
||||
//
|
||||
~TestWindow()
|
||||
{
|
||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||
}
|
||||
|
||||
// MessageReceived()
|
||||
//
|
||||
void MessageReceived(BMessage *msg)
|
||||
{
|
||||
switch (msg->what)
|
||||
{
|
||||
case MSG_TEST_CANCEL:
|
||||
Quit();
|
||||
break;
|
||||
|
||||
default:
|
||||
BWindow::MessageReceived(msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
TestView *testView;
|
||||
BMenuBar *menuBar;
|
||||
};
|
||||
|
||||
|
||||
// ----- Application -------------------------------------------------------------------------
|
||||
|
||||
class TestApp : public BApplication
|
||||
{
|
||||
public:
|
||||
TestApp()
|
||||
: BApplication("application/x-vnd.Teldar-MenuTesting")
|
||||
{
|
||||
win = new TestWindow;
|
||||
}
|
||||
|
||||
~TestApp()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
TestWindow *win;
|
||||
};
|
||||
|
||||
// main()
|
||||
//
|
||||
int main()
|
||||
{
|
||||
new TestApp;
|
||||
be_app->Run();
|
||||
delete be_app;
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,147 +0,0 @@
|
||||
#ifndef _BETALK_H_
|
||||
#define _BETALK_H_
|
||||
|
||||
// BeOS-specific includes
|
||||
#include "TypeConstants.h"
|
||||
#include "Errors.h"
|
||||
#include "OS.h"
|
||||
#include "fs_attr.h"
|
||||
#include "fs_query.h"
|
||||
#include "fs_index.h"
|
||||
#include "Mime.h"
|
||||
#include "netdb.h"
|
||||
|
||||
// POSIX includes
|
||||
#include "stdio.h"
|
||||
#include "dirent.h"
|
||||
#include "malloc.h"
|
||||
#include "string.h"
|
||||
#include "sys/stat.h"
|
||||
#include "fcntl.h"
|
||||
#include "errno.h"
|
||||
#include "socket.h"
|
||||
#include "ctype.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0L
|
||||
#endif
|
||||
|
||||
#ifndef INVALID_SOCKET
|
||||
#define INVALID_SOCKET (int)(~0)
|
||||
#endif
|
||||
|
||||
#define BT_TCPIP_PORT 8000
|
||||
#define BT_QUERYHOST_PORT 8001
|
||||
|
||||
#define BT_CMD_TERMINATOR 13
|
||||
#define BT_CMD_MOUNT 1
|
||||
#define BT_CMD_FSINFO 2
|
||||
#define BT_CMD_LOOKUP 3
|
||||
#define BT_CMD_STAT 4
|
||||
#define BT_CMD_READDIR 5
|
||||
#define BT_CMD_READ 6
|
||||
#define BT_CMD_WRITE 7
|
||||
#define BT_CMD_CREATE 8
|
||||
#define BT_CMD_TRUNCATE 9
|
||||
#define BT_CMD_MKDIR 10
|
||||
#define BT_CMD_RMDIR 11
|
||||
#define BT_CMD_RENAME 12
|
||||
#define BT_CMD_UNLINK 13
|
||||
#define BT_CMD_READLINK 14
|
||||
#define BT_CMD_SYMLINK 15
|
||||
#define BT_CMD_WSTAT 16
|
||||
#define BT_CMD_READATTRIB 50
|
||||
#define BT_CMD_WRITEATTRIB 51
|
||||
#define BT_CMD_READATTRIBDIR 52
|
||||
#define BT_CMD_REMOVEATTRIB 53
|
||||
#define BT_CMD_STATATTRIB 54
|
||||
#define BT_CMD_READINDEXDIR 60
|
||||
#define BT_CMD_CREATEINDEX 61
|
||||
#define BT_CMD_REMOVEINDEX 62
|
||||
#define BT_CMD_STATINDEX 63
|
||||
#define BT_CMD_READQUERY 70
|
||||
#define BT_CMD_QUIT 255
|
||||
|
||||
#define BT_RPC_SIGNATURE "btRPC"
|
||||
#define BT_RPC_VERSION_HI 0
|
||||
#define BT_RPC_VERSION_LO 1
|
||||
|
||||
#define BT_MAX_IO_BUFFER 16384
|
||||
#define BT_RPC_MIN_PACKET_SIZE 64
|
||||
#define BT_RPC_MAX_PACKET_SIZE (BT_MAX_IO_BUFFER + 1024)
|
||||
|
||||
#define MAX_COMMAND_ARGS 10
|
||||
#define MAX_ENTRY_VERSIONS 10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int blockSize;
|
||||
unsigned int totalBlocks;
|
||||
unsigned int freeBlocks;
|
||||
} bt_fsinfo;
|
||||
|
||||
#define BT_COOKIE_SIZE 4
|
||||
#define BT_QUERY_COOKIE_SIZE 4
|
||||
#define BT_FILE_HANDLE_SIZE 32
|
||||
|
||||
typedef struct btFileHandle
|
||||
{
|
||||
char opaque[BT_FILE_HANDLE_SIZE];
|
||||
} btFileHandle;
|
||||
|
||||
typedef struct btCookie
|
||||
{
|
||||
char opaque[BT_COOKIE_SIZE];
|
||||
} btCookie;
|
||||
|
||||
typedef struct btQueryCookie
|
||||
{
|
||||
char opaque[BT_COOKIE_SIZE];
|
||||
char *query;
|
||||
} btQueryCookie;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
unsigned int length;
|
||||
char *buffer;
|
||||
} bt_outPacket;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int length;
|
||||
unsigned int offset;
|
||||
char *buffer;
|
||||
} bt_inPacket;
|
||||
|
||||
typedef struct rpcCall
|
||||
{
|
||||
unsigned int xid;
|
||||
sem_id sem;
|
||||
bt_inPacket *inPacket;
|
||||
struct rpcCall *next;
|
||||
struct rpcCall *prev;
|
||||
} bt_rpccall;
|
||||
|
||||
// RPC Operations
|
||||
unsigned int btRPCGetInt32(bt_inPacket *packet);
|
||||
int64 btRPCGetInt64(bt_inPacket *packet);
|
||||
char * btRPCGetNewString(bt_inPacket *packet);
|
||||
int btRPCGetString(bt_inPacket *packet, char *buffer, int length);
|
||||
int btRPCGetHandle(bt_inPacket *packet, btFileHandle *fhandle);
|
||||
int btRPCGetStat(bt_inPacket *packet, struct stat *st);
|
||||
bt_outPacket * btRPCPutHeader(unsigned char command, unsigned char argc);
|
||||
void btRPCPutArg(bt_outPacket *packet, unsigned int type, void *data, int length);
|
||||
void btRPCPutChar(bt_outPacket *packet, char value);
|
||||
void btRPCPutInt32(bt_outPacket *packet, int32 value);
|
||||
void btRPCPutInt64(bt_outPacket *packet, int64 value);
|
||||
void btRPCPutString(bt_outPacket *packet, char *buffer, int length);
|
||||
void btRPCPutBinary(bt_outPacket *packet, void *buffer, int length);
|
||||
void btRPCPutHandle(bt_outPacket *packet, btFileHandle *fhandle);
|
||||
void btRPCPutStat(bt_outPacket *packet, struct stat *st);
|
||||
|
||||
bt_rpccall * btRPCInvoke(int session, bt_outPacket *packet);
|
||||
bt_outPacket *btRPCCreateAck(unsigned int xid, int error, int length);
|
||||
void btRPCSendAck(int client, bt_outPacket *packet);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,246 +0,0 @@
|
||||
#ifndef _FSPROTO_H
|
||||
#define _FSPROTO_H
|
||||
|
||||
#include <sys/dirent.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <iovec.h>
|
||||
#include <OS.h>
|
||||
#include <fs_attr.h>
|
||||
#include <fs_info.h>
|
||||
#include <BeBuild.h>
|
||||
|
||||
typedef dev_t nspace_id;
|
||||
typedef ino_t vnode_id;
|
||||
|
||||
/* UGLY UGLY UGLY */
|
||||
#ifndef _DRIVERS_H
|
||||
struct selectsync;
|
||||
typedef struct selectsync selectsync;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* PUBLIC PART OF THE FILE SYSTEM PROTOCOL
|
||||
*/
|
||||
|
||||
#define WSTAT_MODE 0x0001
|
||||
#define WSTAT_UID 0x0002
|
||||
#define WSTAT_GID 0x0004
|
||||
#define WSTAT_SIZE 0x0008
|
||||
#define WSTAT_ATIME 0x0010
|
||||
#define WSTAT_MTIME 0x0020
|
||||
#define WSTAT_CRTIME 0x0040
|
||||
|
||||
#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
|
||||
|
||||
#define B_CUR_FS_API_VERSION 2
|
||||
|
||||
struct attr_info;
|
||||
struct index_info;
|
||||
|
||||
typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node);
|
||||
typedef int op_write_vnode(void *ns, void *node, char r);
|
||||
typedef int op_remove_vnode(void *ns, void *node, char r);
|
||||
typedef int op_secure_vnode(void *ns, void *node);
|
||||
|
||||
typedef int op_walk(void *ns, void *base, const char *file, char **newpath,
|
||||
vnode_id *vnid);
|
||||
|
||||
typedef int op_access(void *ns, void *node, int mode);
|
||||
|
||||
typedef int op_create(void *ns, void *dir, const char *name,
|
||||
int omode, int perms, vnode_id *vnid, void **cookie);
|
||||
typedef int op_mkdir(void *ns, void *dir, const char *name, int perms);
|
||||
typedef int op_symlink(void *ns, void *dir, const char *name,
|
||||
const char *path);
|
||||
typedef int op_link(void *ns, void *dir, const char *name, void *node);
|
||||
|
||||
typedef int op_rename(void *ns, void *olddir, const char *oldname,
|
||||
void *newdir, const char *newname);
|
||||
typedef int op_unlink(void *ns, void *dir, const char *name);
|
||||
typedef int op_rmdir(void *ns, void *dir, const char *name);
|
||||
|
||||
typedef int op_readlink(void *ns, void *node, char *buf, size_t *bufsize);
|
||||
|
||||
typedef int op_opendir(void *ns, void *node, void **cookie);
|
||||
typedef int op_closedir(void *ns, void *node, void *cookie);
|
||||
typedef int op_rewinddir(void *ns, void *node, void *cookie);
|
||||
typedef int op_readdir(void *ns, void *node, void *cookie, long *num,
|
||||
struct dirent *buf, size_t bufsize);
|
||||
|
||||
typedef int op_open(void *ns, void *node, int omode, void **cookie);
|
||||
typedef int op_close(void *ns, void *node, void *cookie);
|
||||
typedef int op_free_cookie(void *ns, void *node, void *cookie);
|
||||
typedef int op_read(void *ns, void *node, void *cookie, off_t pos, void *buf,
|
||||
size_t *len);
|
||||
typedef int op_write(void *ns, void *node, void *cookie, off_t pos,
|
||||
const void *buf, size_t *len);
|
||||
typedef int op_readv(void *ns, void *node, void *cookie, off_t pos, const iovec *vec,
|
||||
size_t count, size_t *len);
|
||||
typedef int op_writev(void *ns, void *node, void *cookie, off_t pos, const iovec *vec,
|
||||
size_t count, size_t *len);
|
||||
typedef int op_ioctl(void *ns, void *node, void *cookie, int cmd, void *buf,
|
||||
size_t len);
|
||||
typedef int op_setflags(void *ns, void *node, void *cookie, int flags);
|
||||
|
||||
typedef int op_rstat(void *ns, void *node, struct stat *);
|
||||
typedef int op_wstat(void *ns, void *node, struct stat *, long mask);
|
||||
typedef int op_fsync(void *ns, void *node);
|
||||
|
||||
typedef int op_select(void *ns, void *node, void *cookie, uint8 event,
|
||||
uint32 ref, selectsync *sync);
|
||||
typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event,
|
||||
selectsync *sync);
|
||||
|
||||
typedef int op_initialize(const char *devname, void *parms, size_t len);
|
||||
typedef int op_mount(nspace_id nsid, const char *devname, ulong flags,
|
||||
void *parms, size_t len, void **data, vnode_id *vnid);
|
||||
typedef int op_unmount(void *ns);
|
||||
typedef int op_sync(void *ns);
|
||||
typedef int op_rfsstat(void *ns, struct fs_info *);
|
||||
typedef int op_wfsstat(void *ns, struct fs_info *, long mask);
|
||||
|
||||
|
||||
typedef int op_open_attrdir(void *ns, void *node, void **cookie);
|
||||
typedef int op_close_attrdir(void *ns, void *node, void *cookie);
|
||||
typedef int op_rewind_attrdir(void *ns, void *node, void *cookie);
|
||||
typedef int op_read_attrdir(void *ns, void *node, void *cookie, long *num,
|
||||
struct dirent *buf, size_t bufsize);
|
||||
typedef int op_remove_attr(void *ns, void *node, const char *name);
|
||||
typedef int op_rename_attr(void *ns, void *node, const char *oldname,
|
||||
const char *newname);
|
||||
typedef int op_stat_attr(void *ns, void *node, const char *name,
|
||||
struct attr_info *buf);
|
||||
|
||||
typedef int op_write_attr(void *ns, void *node, const char *name, int type,
|
||||
const void *buf, size_t *len, off_t pos);
|
||||
typedef int op_read_attr(void *ns, void *node, const char *name, int type,
|
||||
void *buf, size_t *len, off_t pos);
|
||||
|
||||
typedef int op_open_indexdir(void *ns, void **cookie);
|
||||
typedef int op_close_indexdir(void *ns, void *cookie);
|
||||
typedef int op_rewind_indexdir(void *ns, void *cookie);
|
||||
typedef int op_read_indexdir(void *ns, void *cookie, long *num,
|
||||
struct dirent *buf, size_t bufsize);
|
||||
typedef int op_create_index(void *ns, const char *name, int type, int flags);
|
||||
typedef int op_remove_index(void *ns, const char *name);
|
||||
typedef int op_rename_index(void *ns, const char *oldname,
|
||||
const char *newname);
|
||||
typedef int op_stat_index(void *ns, const char *name, struct index_info *buf);
|
||||
|
||||
typedef int op_open_query(void *ns, const char *query, ulong flags,
|
||||
port_id port, long token, void **cookie);
|
||||
typedef int op_close_query(void *ns, void *cookie);
|
||||
typedef int op_read_query(void *ns, void *cookie, long *num,
|
||||
struct dirent *buf, size_t bufsize);
|
||||
|
||||
typedef struct vnode_ops {
|
||||
op_read_vnode (*read_vnode);
|
||||
op_write_vnode (*write_vnode);
|
||||
op_remove_vnode (*remove_vnode);
|
||||
op_secure_vnode (*secure_vnode);
|
||||
op_walk (*walk);
|
||||
op_access (*access);
|
||||
op_create (*create);
|
||||
op_mkdir (*mkdir);
|
||||
op_symlink (*symlink);
|
||||
op_link (*link);
|
||||
op_rename (*rename);
|
||||
op_unlink (*unlink);
|
||||
op_rmdir (*rmdir);
|
||||
op_readlink (*readlink);
|
||||
op_opendir (*opendir);
|
||||
op_closedir (*closedir);
|
||||
op_free_cookie (*free_dircookie);
|
||||
op_rewinddir (*rewinddir);
|
||||
op_readdir (*readdir);
|
||||
op_open (*open);
|
||||
op_close (*close);
|
||||
op_free_cookie (*free_cookie);
|
||||
op_read (*read);
|
||||
op_write (*write);
|
||||
op_readv (*readv);
|
||||
op_writev (*writev);
|
||||
op_ioctl (*ioctl);
|
||||
op_setflags (*setflags);
|
||||
op_rstat (*rstat);
|
||||
op_wstat (*wstat);
|
||||
op_fsync (*fsync);
|
||||
op_initialize (*initialize);
|
||||
op_mount (*mount);
|
||||
op_unmount (*unmount);
|
||||
op_sync (*sync);
|
||||
op_rfsstat (*rfsstat);
|
||||
op_wfsstat (*wfsstat);
|
||||
op_select (*select);
|
||||
op_deselect (*deselect);
|
||||
op_open_indexdir (*open_indexdir);
|
||||
op_close_indexdir (*close_indexdir);
|
||||
op_free_cookie (*free_indexdircookie);
|
||||
op_rewind_indexdir (*rewind_indexdir);
|
||||
op_read_indexdir (*read_indexdir);
|
||||
op_create_index (*create_index);
|
||||
op_remove_index (*remove_index);
|
||||
op_rename_index (*rename_index);
|
||||
op_stat_index (*stat_index);
|
||||
op_open_attrdir (*open_attrdir);
|
||||
op_close_attrdir (*close_attrdir);
|
||||
op_free_cookie (*free_attrdircookie);
|
||||
op_rewind_attrdir (*rewind_attrdir);
|
||||
op_read_attrdir (*read_attrdir);
|
||||
op_write_attr (*write_attr);
|
||||
op_read_attr (*read_attr);
|
||||
op_remove_attr (*remove_attr);
|
||||
op_rename_attr (*rename_attr);
|
||||
op_stat_attr (*stat_attr);
|
||||
op_open_query (*open_query);
|
||||
op_close_query (*close_query);
|
||||
op_free_cookie (*free_querycookie);
|
||||
op_read_query (*read_query);
|
||||
} vnode_ops;
|
||||
|
||||
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,
|
||||
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,
|
||||
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 _EXPORT vnode_ops fs_entry;
|
||||
extern _EXPORT int32 api_version;
|
||||
|
||||
#endif
|
||||
@@ -1,319 +0,0 @@
|
||||
## BeOS Generic Makefile ##
|
||||
|
||||
## Fill in the top section of this makefile to define exactly what sort of
|
||||
## binary you are creating, and what sources, resources and libraries are
|
||||
## needed to create it. The makefile will then determine the proper
|
||||
## platform specific options.
|
||||
|
||||
## Fill in the top section to define the binary being created and the makefile
|
||||
## will make sure that all of the hard work is taken care of for you, for both
|
||||
## PowerPC and Intel versions of the BeOS.
|
||||
|
||||
## Application Specific Settings ---------------------------------------------
|
||||
|
||||
# specify the name of the binary
|
||||
NAME= betalk
|
||||
|
||||
# specify the type of binary
|
||||
# APP: Application
|
||||
# SHARED: Shared library or add-on
|
||||
# STATIC: Static library archive
|
||||
# DRIVER: Kernel Driver
|
||||
TYPE= DRIVER
|
||||
|
||||
# specify the source files to use
|
||||
# full paths or paths relative to the makefile can be included
|
||||
# all files, regardless of directory, will have their object
|
||||
# files created in the common object directory.
|
||||
# Note that this means this makefile will not work correctly
|
||||
# if two source files with the same name (source.c or source.cpp)
|
||||
# are included from different directories. Also note that spaces
|
||||
# in folder names do not work well with this makefile.
|
||||
SRCS= nfs_add_on.c btClient.c
|
||||
|
||||
# specify the resource files to use
|
||||
# full path or a relative path to the resource file can be used.
|
||||
RSRCS=
|
||||
|
||||
#specify additional libraries to link against
|
||||
# if libName.so or libName.a is the name of the library to link against
|
||||
# then simply specify Name in the LIBS list
|
||||
# if there is another naming scheme use the full binary
|
||||
# name: my_library.so or my_lib.a
|
||||
# libroot.so never needs to be specified here, although libbe.so does
|
||||
LIBS= ksocket
|
||||
|
||||
# specify the paths to directories where additional
|
||||
# libraries are to be found. /boot/develop/lib/PLATFORM/ is
|
||||
# already set. The paths can be full or relative to this
|
||||
# makefile. The paths included may not be recursive, so
|
||||
# specify all of the needed paths explicitly
|
||||
# Directories containing source-files are automatically added.
|
||||
LIBPATHS=ksocket_v3/libksocket/$(OBJ_DIR)
|
||||
|
||||
# specify additional directories where header files can be found
|
||||
# directories where sources are found are included automatically
|
||||
# included.
|
||||
INCPATHS= ksocket_v3/libksocket
|
||||
|
||||
# specify the level of optimization that you desire
|
||||
# NONE, SOME, FULL
|
||||
OPTIMIZE=
|
||||
|
||||
# specify any symbols to be defined. The symbols will be
|
||||
# set to a value of 1. For example specify DEBUG if you want
|
||||
# DEBUG=1 to be set when compiling.
|
||||
DEFINES=
|
||||
|
||||
# specify special warning levels
|
||||
# if unspecified default warnings will be used
|
||||
# NONE = supress all warnings
|
||||
# ALL = enable all warnings
|
||||
WARNINGS =
|
||||
|
||||
# specify symbols
|
||||
# if TRUE debug symbols will be created
|
||||
SYMBOLS =
|
||||
|
||||
|
||||
## Generic Makefile Rules ---------------------------
|
||||
## DO NOT MODIFY BENEATH THIS LINE -----------------
|
||||
|
||||
# determine wheather running on x86 or ppc
|
||||
MACHINE=$(shell uname -m)
|
||||
ifeq ($(MACHINE), BePC)
|
||||
CPU = x86
|
||||
else
|
||||
CPU = ppc
|
||||
endif
|
||||
|
||||
# set the directory where object files and binaries will be created
|
||||
OBJ_DIR := obj.$(CPU)
|
||||
|
||||
# specify that the binary should be created in the object directory
|
||||
TARGET := $(OBJ_DIR)/$(NAME)
|
||||
|
||||
# specify the mimeset tool
|
||||
MIMESET := mimeset
|
||||
|
||||
# specify the tools for adding and removing resources
|
||||
XRES = xres
|
||||
|
||||
# SETTING: define debug symbols if desired
|
||||
ifeq ($(SYMBOLS), TRUE)
|
||||
CFLAGS += -g
|
||||
endif
|
||||
|
||||
|
||||
# platform specific settings
|
||||
|
||||
# x86 Settings
|
||||
ifeq ($(CPU), x86)
|
||||
# set the compiler and compiler flags
|
||||
CC = gcc
|
||||
##!! change next time : drivers get -no-fpic and -fpic goes away !!
|
||||
CFLAGS += -fpic
|
||||
|
||||
# SETTING: set the proper optimization level
|
||||
ifeq ($(OPTIMIZE), FULL)
|
||||
OPTIMIZER = -O3
|
||||
else
|
||||
ifeq ($(OPTIMIZE), SOME)
|
||||
OPTIMIZER = -O1
|
||||
else
|
||||
ifeq ($(OPTIMIZE), NONE)
|
||||
OPTIMIZER =
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(OPTIMIZER)
|
||||
|
||||
# SETTING: set warning level
|
||||
ifeq ($(WARNINGS), ALL)
|
||||
CFLAGS += -Wall -Wno-multichar -Wno-ctor-dtor-privacy
|
||||
else
|
||||
ifeq ($(WARNINGS), NONE)
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
# set the linker and linker flags
|
||||
LD = gcc
|
||||
LDFLAGS =
|
||||
|
||||
# SETTING: set linker flags for each binary type
|
||||
ifeq ($(TYPE), APP)
|
||||
LDFLAGS += -Xlinker -soname=_APP_
|
||||
else
|
||||
ifeq ($(TYPE), SHARED)
|
||||
LDFLAGS += -addon -Xlinker -soname=$(NAME)
|
||||
else
|
||||
ifeq ($(TYPE), DRIVER)
|
||||
LDFLAGS += -nostdlib /boot/develop/lib/x86/_KERNEL_
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
# ppc Settings
|
||||
ifeq ($(CPU), ppc)
|
||||
# set the compiler and compiler flags
|
||||
CC = mwcc
|
||||
CFLAGS +=
|
||||
|
||||
# SETTING: set the proper optimization level
|
||||
ifeq ($(OPTIMIZE), FULL)
|
||||
OPTIMIZER = -O7
|
||||
else
|
||||
ifeq ($(OPTIMIZE), SOME)
|
||||
OPTIMIZER = -O3
|
||||
else
|
||||
ifeq ($(OPTIMIZE), NONE)
|
||||
OPTIMIZER =
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(OPTIMIZER)
|
||||
|
||||
# SETTING: set warning level
|
||||
ifeq ($(WARNINGS), ALL)
|
||||
CFLAGS += -w all
|
||||
else
|
||||
ifeq ($(WARNINGS), NONE)
|
||||
CFLAGS += -w 0
|
||||
endif
|
||||
endif
|
||||
|
||||
# clear the standard environment variable
|
||||
# now there are no standard libraries to link against
|
||||
BELIBFILES=
|
||||
|
||||
# set the linker and linker flags
|
||||
LD = mwldppc
|
||||
|
||||
ifeq ($(TYPE), APP)
|
||||
LDFLAGS +=
|
||||
else
|
||||
ifeq ($(TYPE), SHARED)
|
||||
LDFLAGS += -xms
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TYPE), DRIVER)
|
||||
LDFLAGS += -nodefaults \
|
||||
-export all \
|
||||
-G \
|
||||
/boot/develop/lib/ppc/glue-noinit.a \
|
||||
/boot/develop/lib/ppc/_KERNEL_
|
||||
else
|
||||
# override the standard environment variable
|
||||
LDFLAGS += -export pragma \
|
||||
-init _init_routine_ \
|
||||
-term _term_routine_ \
|
||||
-lroot \
|
||||
/boot/develop/lib/ppc/glue-noinit.a \
|
||||
/boot/develop/lib/ppc/init_term_dyn.o \
|
||||
/boot/develop/lib/ppc/start_dyn.o
|
||||
|
||||
endif
|
||||
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# psuedo-function for converting a list of source files in SRCS variable
|
||||
# to a corresponding list of object files in $(OBJ_DIR)/xxx.o
|
||||
# The "function" strips off the src file suffix (.ccp or .c or whatever)
|
||||
# and then strips of the directory name, leaving just the root file name.
|
||||
# It then appends the .o suffix and prepends the $(OBJ_DIR)/ path
|
||||
define SRCS_LIST_TO_OBJS
|
||||
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \
|
||||
$(basename $(notdir $(file))))))
|
||||
endef
|
||||
|
||||
OBJS = $(SRCS_LIST_TO_OBJS)
|
||||
|
||||
# create a unique list of paths to our sourcefiles
|
||||
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file))))
|
||||
|
||||
# add source paths to VPATH if not already present
|
||||
VPATH :=
|
||||
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
|
||||
|
||||
# add source paths and include paths to INLCUDES if not already present
|
||||
INCLUDES = $(foreach path, $(INCPATHS) $(SRC_PATHS), $(addprefix -I, $(path)))
|
||||
|
||||
|
||||
# SETTING: add the -L prefix to all library paths to search
|
||||
LINK_PATHS = $(foreach path, $(LIBPATHS) $(SRC_PATHS) , \
|
||||
$(addprefix -L, $(path)))
|
||||
|
||||
# SETTING: add the -l prefix to all libs to be linked against
|
||||
LINK_LIBS = $(foreach lib, $(LIBS), $(addprefix -l, $(lib)))
|
||||
|
||||
# add to the linker flags
|
||||
LDFLAGS += $(LINK_PATHS) $(LINK_LIBS)
|
||||
|
||||
# SETTING: add the defines to the compiler flags
|
||||
CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
|
||||
|
||||
# SETTING: use the archive tools if building a static library
|
||||
# otherwise use the linker
|
||||
ifeq ($(TYPE), STATIC)
|
||||
BUILD_LINE = ar -cru $(NAME) $(OBJS)
|
||||
else
|
||||
BUILD_LINE = $(LD) -o $@ $(OBJS) $(LDFLAGS)
|
||||
endif
|
||||
|
||||
# create the resource instruction
|
||||
ifeq ($(RSRCS), )
|
||||
DO_RSRCS :=
|
||||
else
|
||||
DO_RSRCS := $(XRES) -o $(TARGET) $(RSRCS)
|
||||
endif
|
||||
|
||||
|
||||
# define the actual work to be done
|
||||
default: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJ_DIR) $(OBJS) $(RSRCS) ksocket_v3/libksocket/$(OBJ_DIR)/libksocket.a
|
||||
$(BUILD_LINE)
|
||||
$(DO_RSRCS)
|
||||
$(MIMESET) -f $@
|
||||
|
||||
|
||||
# rule to create the object file directory if needed
|
||||
$(OBJ_DIR)::
|
||||
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
|
||||
|
||||
$(OBJ_DIR)/%.o : %.c
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
||||
$(OBJ_DIR)/%.o : %.cpp
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
||||
$(OBJ_DIR)/%.o : %.cp
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
||||
$(OBJ_DIR)/%.o : %.C
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
||||
$(OBJ_DIR)/%.o : %.CC
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
||||
$(OBJ_DIR)/%.o : %.CPP
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
||||
|
||||
|
||||
# empty rule. Things that depend on this rule will always get triggered
|
||||
FORCE:
|
||||
|
||||
# The generic clean command. Delete everything in the object folder.
|
||||
clean :: FORCE
|
||||
-rm -rf $(OBJ_DIR)
|
||||
|
||||
# remove just the application from the object folder
|
||||
rmapp ::
|
||||
-rm -f $(TARGET)
|
||||
|
||||
ksocket_v3/libksocket/$(OBJ_DIR)/libksocket.a :: FORCE
|
||||
cd ksocket_v3/libksocket; make
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,140 +0,0 @@
|
||||
#ifndef _NFS_ADD_ON_H
|
||||
#define _NFS_ADD_ON_H
|
||||
|
||||
#include "fsproto.h"
|
||||
#include "betalk.h"
|
||||
|
||||
#include <Errors.h>
|
||||
#include <sys/stat.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
struct mount_bt_params
|
||||
{
|
||||
unsigned int serverIP;
|
||||
char *server;
|
||||
char *export;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
char *hostname;
|
||||
};
|
||||
|
||||
struct fs_node
|
||||
{
|
||||
vnode_id vnid;
|
||||
struct btFileHandle fhandle;
|
||||
struct fs_node *next;
|
||||
};
|
||||
|
||||
struct fs_nspace
|
||||
{
|
||||
nspace_id nsid;
|
||||
|
||||
thread_id tid;
|
||||
bool quit;
|
||||
int s;
|
||||
|
||||
struct sockaddr_in mountAddr,nfsAddr;
|
||||
|
||||
int32 xid;
|
||||
|
||||
vnode_id rootid;
|
||||
|
||||
sem_id sem;
|
||||
struct fs_node *first;
|
||||
|
||||
struct mount_bt_params params;
|
||||
};
|
||||
|
||||
struct fs_file_cookie
|
||||
{
|
||||
int omode;
|
||||
off_t original_size;
|
||||
struct stat st;
|
||||
};
|
||||
|
||||
typedef struct fs_nspace fs_nspace;
|
||||
typedef struct fs_node fs_node;
|
||||
typedef struct fs_file_cookie fs_file_cookie;
|
||||
|
||||
int fs_read_vnode(fs_nspace *ns, vnode_id vnid, char r, fs_node **node);
|
||||
int fs_write_vnode(fs_nspace *ns, fs_node *node, char r);
|
||||
|
||||
int fs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath,
|
||||
vnode_id *vnid);
|
||||
|
||||
int fs_opendir(fs_nspace *ns, fs_node *node, btCookie **cookie);
|
||||
int fs_closedir(fs_nspace *ns, fs_node *node, btCookie *cookie);
|
||||
int fs_rewinddir(fs_nspace *ns, fs_node *node, btCookie *cookie);
|
||||
int fs_readdir(fs_nspace *ns, fs_node *node, btCookie *cookie, long *num,
|
||||
struct dirent *buf, size_t bufsize);
|
||||
|
||||
int fs_free_dircookie(fs_nspace *ns, fs_node *node, btCookie *cookie);
|
||||
int fs_rstat(fs_nspace *ns, fs_node *node, struct stat *);
|
||||
int fs_mount(nspace_id nsid, const char *devname, ulong flags,
|
||||
struct mount_bt_params *parms, size_t len, fs_nspace **data, vnode_id *vnid);
|
||||
int fs_unmount(fs_nspace *ns);
|
||||
int fs_rfsstat(fs_nspace *ns, struct fs_info *);
|
||||
|
||||
int fs_open(fs_nspace *ns, fs_node *node, int omode, fs_file_cookie **cookie);
|
||||
int fs_close(fs_nspace *ns, fs_node *node, fs_file_cookie *cookie);
|
||||
int fs_free_cookie(fs_nspace *ns, fs_node *node, fs_file_cookie *cookie);
|
||||
int fs_read(fs_nspace *ns, fs_node *node, fs_file_cookie *cookie, off_t pos, void *buf,
|
||||
size_t *len);
|
||||
|
||||
int fs_write(fs_nspace *ns, fs_node *node, fs_file_cookie *cookie, off_t pos,
|
||||
const void *buf, size_t *len);
|
||||
|
||||
int fs_wstat(fs_nspace *ns, fs_node *node, struct stat *, long mask);
|
||||
int fs_wfsstat(fs_nspace *ns, struct fs_info *, long mask);
|
||||
int fs_create(fs_nspace *ns, fs_node *dir, const char *name,
|
||||
int omode, int perms, vnode_id *vnid, fs_file_cookie **cookie);
|
||||
|
||||
int fs_unlink(fs_nspace *ns, fs_node *dir, const char *name);
|
||||
int fs_remove_vnode(fs_nspace *ns, fs_node *node, char r);
|
||||
int fs_secure_vnode(fs_nspace *ns, fs_node *node);
|
||||
|
||||
int fs_mkdir(fs_nspace *ns, fs_node *dir, const char *name, int perms);
|
||||
|
||||
int fs_rename(fs_nspace *ns, fs_node *olddir, const char *oldname,
|
||||
fs_node *newdir, const char *newname);
|
||||
|
||||
int fs_rmdir(fs_nspace *ns, fs_node *dir, const char *name);
|
||||
int fs_readlink(fs_nspace *ns, fs_node *node, char *buf, size_t *bufsize);
|
||||
|
||||
int fs_symlink(fs_nspace *ns, fs_node *dir, const char *name,
|
||||
const char *path);
|
||||
|
||||
btFileHandle handle_from_vnid (fs_nspace *ns, vnode_id vnid);
|
||||
|
||||
extern status_t bt_getattr(fs_nspace *ns, const btFileHandle *fhandle, struct stat *st);
|
||||
extern void insert_node(fs_nspace *ns, fs_node *node);
|
||||
extern void remove_node(fs_nspace *ns, vnode_id vnid);
|
||||
|
||||
extern int fs_access(void *ns, void *node, int mode);
|
||||
|
||||
extern int fs_read_attrib(fs_nspace *ns, fs_node *node, const char *name, int type, void *buf, size_t *len, off_t pos);
|
||||
extern int fs_write_attrib(fs_nspace *ns, fs_node *node, const char *name, int type, const void *buf, size_t *len, off_t pos);
|
||||
extern int fs_open_attribdir(fs_nspace *ns, fs_node *node, btCookie **cookie);
|
||||
extern int fs_close_attribdir(fs_nspace *ns, fs_node *node, btCookie *cookie);
|
||||
extern int fs_rewind_attribdir(fs_nspace *ns, fs_node *node, btCookie *cookie);
|
||||
extern int fs_read_attribdir(fs_nspace *ns, fs_node *node, btCookie *cookie, long *num, struct dirent *buf, size_t bufsize);
|
||||
extern int fs_remove_attrib(fs_nspace *ns, fs_node *node, const char *name);
|
||||
extern int fs_stat_attrib(fs_nspace *ns, fs_node *node, const char *name, struct attr_info *buf);
|
||||
|
||||
extern int fs_open_indexdir(fs_nspace *ns, btCookie **cookie);
|
||||
extern int fs_close_indexdir(fs_nspace *ns, btCookie *cookie);
|
||||
extern int fs_rewind_indexdir(fs_nspace *ns, btCookie *cookie);
|
||||
extern int fs_read_indexdir(fs_nspace *ns, btCookie *cookie, long *num, struct dirent *buf, size_t bufsize);
|
||||
extern int fs_free_indexdircookie(fs_nspace *ns, btCookie *cookie);
|
||||
extern int fsCreateIndex(fs_nspace *ns, const char *name, int type, int flags);
|
||||
extern int fsRemoveIndex(fs_nspace *ns, const char *name);
|
||||
extern int fsStatIndex(fs_nspace *ns, const char *name, struct index_info *buf);
|
||||
|
||||
enum
|
||||
{
|
||||
C_ERROR_STALE=B_ERRORS_END+1
|
||||
};
|
||||
|
||||
#define USE_SYSTEM_AUTHENTICATION 1
|
||||
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,203 +0,0 @@
|
||||
#include <DataIO.h>
|
||||
#include <Message.h>
|
||||
#include <Directory.h>
|
||||
#include <netdb.h>
|
||||
#include <Alert.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <iomanip>
|
||||
|
||||
#include "betalk.h"
|
||||
#include "beserved_transport.h"
|
||||
#include "beserved_printer.h"
|
||||
#include "beserved_rpc.h"
|
||||
#include "transport_rpc.h"
|
||||
|
||||
#include "LoginPanel.h"
|
||||
#include "BlowFish.h"
|
||||
|
||||
#define SPOOL_FILE_TYPE "application/x-vnd.Be.printer-spool"
|
||||
|
||||
|
||||
#if (!__MWERKS__ || defined(WIN32))
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
BeServedTransport::BeServedTransport(BMessage *msg)
|
||||
: BDataIO()
|
||||
{
|
||||
server[0] = 0;
|
||||
printerName[0] = 0;
|
||||
file[0] = 0;
|
||||
user[0] = 0;
|
||||
password[0] = 0;
|
||||
jobId = 0;
|
||||
error = false;
|
||||
|
||||
const char *spool_path = msg->FindString(SPOOL_PATH);
|
||||
if (spool_path && *spool_path)
|
||||
{
|
||||
dir.SetTo(spool_path);
|
||||
|
||||
dir.ReadAttr(SERVER_NAME, B_STRING_TYPE, 0, server, sizeof(server));
|
||||
dir.ReadAttr(PRINTER_NAME, B_STRING_TYPE, 0, printerName, sizeof(printerName));
|
||||
dir.ReadAttr(USER_NAME, B_STRING_TYPE, 0, user, sizeof(user));
|
||||
dir.ReadAttr(USER_PASSWORD, B_STRING_TYPE, 0, password, sizeof(password));
|
||||
|
||||
do
|
||||
{
|
||||
sprintf(file, "%s/%lx-%ld", spool_path, time(NULL), jobId++);
|
||||
} while (access(file, 0) == 0);
|
||||
|
||||
fs.open(file, ios::in | ios::out | ios::binary | ios::trunc);
|
||||
if (fs.good())
|
||||
return;
|
||||
}
|
||||
|
||||
error = true;
|
||||
}
|
||||
|
||||
BeServedTransport::~BeServedTransport()
|
||||
{
|
||||
bt_rpcinfo info;
|
||||
hostent *ent;
|
||||
char jobName[100], msg[256], *serverJobId, *buffer;
|
||||
int bytes;
|
||||
|
||||
strcpy(jobName, "BeServed Print Job");
|
||||
fs.close();
|
||||
|
||||
// Get the IP address of the server.
|
||||
ent = gethostbyname(server);
|
||||
if (ent == NULL)
|
||||
{
|
||||
sprintf(msg, "The server %s, which hosts printer %s, cannot be found on the network.", server, printerName);
|
||||
BAlert *alert = new BAlert("", msg, "OK");
|
||||
alert->Go();
|
||||
remove(file);
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int serverIP = ntohl(*((unsigned int *) ent->h_addr));
|
||||
buffer = new char [BT_MAX_IO_BUFFER + 10];
|
||||
|
||||
// Initialize the RPC system.
|
||||
btRPCInit(&info);
|
||||
|
||||
// Connect to the remote host.
|
||||
info.s = btConnect(&info, serverIP, BT_TCPIP_PORT);
|
||||
if (info.s != INVALID_SOCKET)
|
||||
{
|
||||
int error;
|
||||
|
||||
// Try to start the new print job. If we get an access denied message, we may need
|
||||
// to query for new credentials (permissions may have changed on the server since our
|
||||
// last print job). Keep asking for a new username/password until we either get a
|
||||
// successful authentication or the user cancels.
|
||||
while (true)
|
||||
{
|
||||
error = btStartPrintJob(&info, printerName, user, password, jobName, &serverJobId);
|
||||
if (error != EACCES)
|
||||
break;
|
||||
else if (!getNewCredentials())
|
||||
break;
|
||||
}
|
||||
|
||||
// If we didn't receive an error, go ahead and read the file in 8K chunks. Send each
|
||||
// chunk through the RPC protocol, aborting if an error occurs.
|
||||
if (error == B_OK)
|
||||
{
|
||||
FILE *fp = fopen(file, "rb");
|
||||
if (fp)
|
||||
{
|
||||
do
|
||||
{
|
||||
bytes = fread(buffer, 1, BT_MAX_IO_BUFFER, fp);
|
||||
if (bytes > 0)
|
||||
{
|
||||
buffer[bytes] = 0;
|
||||
if (btPrintJobData(&info, printerName, serverJobId, buffer, bytes) != B_OK)
|
||||
break;
|
||||
}
|
||||
} while (bytes > 0);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
// Now that all the data has been transmitted for the print job, start printing by
|
||||
// committing the job on the server. This ends local responsibility for the task.
|
||||
// Then it's up to the server.
|
||||
btCommitPrintJob(&info, printerName, serverJobId);
|
||||
}
|
||||
else
|
||||
{
|
||||
BAlert *alert = new BAlert("", "Your print job could not be started. This network printer may no longer be available, or you may not have permission to use it.", "OK");
|
||||
alert->Go();
|
||||
}
|
||||
|
||||
// End our connection with the remote host.
|
||||
btDisconnect(&info);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(msg, "The server %s, which hosts printer %s, is not responding.", server, printerName);
|
||||
BAlert *alert = new BAlert("", msg, "OK");
|
||||
alert->Go();
|
||||
}
|
||||
|
||||
// Shut down the RPC system.
|
||||
btRPCClose(&info);
|
||||
|
||||
// Clean up.
|
||||
delete [] buffer;
|
||||
remove(file);
|
||||
}
|
||||
|
||||
ssize_t BeServedTransport::Read(void *, size_t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t BeServedTransport::Write(const void *buffer, size_t size)
|
||||
{
|
||||
if (!fs.write(buffer, size))
|
||||
{
|
||||
error = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
bool BeServedTransport::getNewCredentials()
|
||||
{
|
||||
blf_ctx ctx;
|
||||
int length;
|
||||
|
||||
BRect frame(0, 0, LOGIN_PANEL_WIDTH, LOGIN_PANEL_HEIGHT);
|
||||
LoginPanel *login = new LoginPanel(frame, server, printerName, false);
|
||||
login->Center();
|
||||
status_t loginExit;
|
||||
wait_for_thread(login->Thread(), &loginExit);
|
||||
if (login->IsCancelled())
|
||||
return false;
|
||||
|
||||
// Copy the user name.
|
||||
strcpy(user, login->user);
|
||||
|
||||
// Copy the user name and password supplied in the authentication dialog.
|
||||
sprintf(password, "%-*s%-*s", B_FILE_NAME_LENGTH, printerName, MAX_USERNAME_LENGTH, login->user);
|
||||
length = strlen(password);
|
||||
assert(length == BT_AUTH_TOKEN_LENGTH);
|
||||
|
||||
password[length] = 0;
|
||||
blf_key(&ctx, (unsigned char *) login->md5passwd, strlen(login->md5passwd));
|
||||
blf_enc(&ctx, (unsigned long *) password, length / 4);
|
||||
|
||||
dir.WriteAttr(USER_NAME, B_STRING_TYPE, 0, user, sizeof(user));
|
||||
dir.WriteAttr(USER_PASSWORD, B_STRING_TYPE, 0, password, sizeof(password));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#ifndef _beserved_transport_h_
|
||||
#define _beserved_transport_h_
|
||||
|
||||
#include <Directory.h>
|
||||
#include <DataIO.h>
|
||||
#include <Message.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "betalk.h"
|
||||
|
||||
|
||||
#if (!__MWERKS__ || defined(WIN32))
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
class BeServedTransport : public BDataIO
|
||||
{
|
||||
public:
|
||||
BeServedTransport(BMessage *msg);
|
||||
virtual ~BeServedTransport();
|
||||
virtual ssize_t Read(void *buffer, size_t size);
|
||||
virtual ssize_t Write(const void *buffer, size_t size);
|
||||
|
||||
bool getNewCredentials();
|
||||
|
||||
bool operator !() const;
|
||||
bool fail() const;
|
||||
|
||||
private:
|
||||
char server[256];
|
||||
char printerName[256];
|
||||
|
||||
BDirectory dir;
|
||||
char file[B_PATH_NAME_LENGTH];
|
||||
|
||||
char user[MAX_USERNAME_LENGTH + 1];
|
||||
char password[BT_AUTH_TOKEN_LENGTH * 2 + 1];
|
||||
|
||||
int32 jobId;
|
||||
fstream fs;
|
||||
bool error;
|
||||
};
|
||||
|
||||
inline bool BeServedTransport::fail() const
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
inline bool BeServedTransport::operator !() const
|
||||
{
|
||||
return fail();
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user