mars-nwe/nwdbm.h

171 lines
5.2 KiB
C

/* nwdbm.h 11-Sep-95 */
/* (C)opyright (C) 1993,1995 Martin Stover, Marburg, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define NETOBJ_KEY_SIZE 4
typedef struct {
uint32 id; /* Objekt ID */
/* --------------- */
uint8 name[48];
uint16 type;
uint8 flags; /* statisch, dynamisch */
uint8 security;
} NETOBJ;
#define NETPROP_KEY_SIZE 5
typedef struct {
uint32 obj_id; /* ID OBJECT */
uint8 id; /* PROPERTY id */
/* --------------- */
uint8 name[16];
uint8 flags; /* statisch, dynamisch */
uint8 security;
} NETPROP;
#define NETVAL_KEY_SIZE 6
typedef struct {
uint32 obj_id; /* ID OBJECT */
uint8 prop_id; /* PROPERTY id */
uint8 segment; /* Segment Nr */
/* --------------- */
uint8 value[128]; /* Inhalt */
} NETVAL;
/* Object Flags */
#define O_FL_STAT 0x0
#define O_FL_DYNA 0x1
/* Property Flags */
/* BIT 7 */
#define P_FL_STAT 0x0
#define P_FL_DYNA 0x1
/* BIT 6 */
#define P_FL_ITEM 0x0
#define P_FL_SET 0x2
extern int nw_get_prop(int object_type,
uint8 *object_name, int object_namlen,
int segment_nr,
uint8 *prop_name, int prop_namlen,
uint8 *property_value,
uint8 *more_segments,
uint8 *property_flags);
extern int find_obj_id(NETOBJ *o, uint32 last_obj_id);
extern int nw_delete_obj(NETOBJ *obj);
extern int nw_rename_obj(NETOBJ *o, uint8 *newname);
extern int nw_change_obj_security(NETOBJ *o, int newsecurity);
extern int nw_get_obj(NETOBJ *o);
extern int prop_find_member(uint32 obj_id, int prop_id, uint32 member_id);
extern int prop_add_member(uint32 obj_id, int prop_id, uint32 member_id);
extern int prop_delete_member(uint32 obj_id, int prop_id, uint32 member_id);
extern int ins_prop_val(uint32 obj_id, uint8 prop_id, int segment,
uint8 *property_value, int erase_segments);
extern int nw_get_prop_val_by_obj_id(uint32 obj_id,
int segment_nr,
uint8 *prop_name, int prop_namlen,
uint8 *property_value,
uint8 *more_segments,
uint8 *property_flags);
extern int nw_get_prop_val(int object_type,
uint8 *object_name, int object_namlen,
int segment_nr,
uint8 *prop_name, int prop_namlen,
uint8 *property_value,
uint8 *more_segments,
uint8 *property_flags);
extern int nw_delete_property(int object_type,
uint8 *object_name, int object_namlen,
uint8 *prop_name, int prop_namlen);
extern int nw_is_obj_in_set(int object_type,
uint8 *object_name, int object_namlen,
uint8 *prop_name, int prop_namlen,
int member_type,
uint8 *member_name, int member_namlen);
extern int nw_add_obj_to_set(int object_type,
uint8 *object_name, int object_namlen,
uint8 *prop_name, int prop_namlen,
int member_type,
uint8 *member_name, int member_namlen);
extern int nw_delete_obj_from_set(int object_type,
uint8 *object_name, int object_namlen,
uint8 *prop_name, int prop_namlen,
int member_type,
uint8 *member_name, int member_namlen);
extern int nw_write_prop_value(int object_type,
uint8 *object_name, int object_namlen,
int segment_nr, int erase_segments,
uint8 *prop_name, int prop_namlen,
uint8 *property_value);
extern int nw_change_prop_security(int object_type,
uint8 *object_name, int object_namlen,
uint8 *prop_name, int prop_namlen,
int prop_security);
extern int nw_scan_property(NETPROP *prop,
int object_type,
uint8 *object_name,
int object_namlen,
uint8 *prop_name,
int prop_namlen,
uint32 *last_scan);
extern int nw_create_obj(NETOBJ *obj, uint32 wanted_id);
extern int nw_obj_has_prop(NETOBJ *obj);
extern int nw_create_obj_prop(NETOBJ *obj, NETPROP *prop);
extern int nw_create_prop(int object_type,
uint8 *object_name, int object_namlen,
uint8 *prop_name, int prop_namlen,
int prop_flags, int prop_security);
extern uint32 nw_new_create_prop(uint32 wanted_id,
char *objname, int objtype, int objflags, int objsecurity,
char *propname, int propflags, int propsecurity,
char *value, int valuesize);
extern void nw_init_dbm(char *servername, ipxAddr_t *adr);