48 lines
906 B
C++
48 lines
906 B
C++
|
|
// Device.h
|
|
// Device object for use in devfs
|
|
// Author: Josh Holtrop
|
|
// Date: 06/03/04
|
|
// Modified: 06/08/04
|
|
|
|
#ifndef __HOS_DEVICE__
|
|
#define __HOS_DEVICE__ __HOS_DEVICE__
|
|
|
|
#include "hos_defines.h"
|
|
#include "lang/string.h"
|
|
#include "lang/LinkedList.h"
|
|
|
|
#define DEVICE_FOLDER 0
|
|
#define DEVICE_BLOCK 1
|
|
#define DEVICE_CHAR 2
|
|
#define DEVICE_LINK 3
|
|
|
|
class Device
|
|
{
|
|
public:
|
|
string name;
|
|
union
|
|
{
|
|
dword major;
|
|
//can't be DeviceFolder * because not then Device & DeviceFolder are inter-dependent
|
|
void *folder;
|
|
string *link;
|
|
};
|
|
dword uid;
|
|
dword gid;
|
|
dword minor;
|
|
word permissions; //0644 or similar
|
|
char type; //'b', 'c', 'l', 'd'
|
|
|
|
Device();
|
|
Device(string aname);
|
|
Device(string aname, dword auid, dword agid, dword amajor, dword aminor, char atype, word apermissions);
|
|
Device(const Device & orig);
|
|
~Device();
|
|
Device & operator=(const Device & orig);
|
|
void setLink(string alink);
|
|
};
|
|
|
|
#endif
|
|
|