home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
usms1.exe
/
SIDF.H
< prev
next >
Wrap
Text File
|
1994-06-01
|
5KB
|
127 lines
/*
****************************************************************************
*
* Program Name: Storage Management Services (NWSMS Lib)
*
* Filename: SIDF.H
*
* Date Created: 15 SEPTEMBER 1993
*
* Version: 5.0
*
* Files used:
*
* Date Modified:
*
* Modifications:
*
* Comments: Header file defining types, macros and constants for
* manipulating SIDF-compliant data fields
*
* (C) Unpublished Copyright of Novell, Inc. All Rights Reserved.
*
* No part of this file may be duplicated, revised, translated, localized or
* modified in any manner or compiled, linked or uploaded or downloaded to or
* from any computer system without the prior written consent of Novell, Inc.
*
****************************************************************************
*/
#ifndef _SIDF_H_INCLUDED /* sidf.h header Latch */
#define _SIDF_H_INCLUDED
#define SIDF_SYNC_DATA 0x5AA5
#define SIDF_FIELD_HEADER_SIZE 14
#define SIDF_INVALID_OFFSET 0xFFFFFFFF
#define SIDFSTREAM_CSTR_FAILURE(c) {dstrSIDFStream(c); return(NULL);}
#define SIDF_MIN_BLANK_SECTION_SIZE 32
/* --------------------------------------------------------------------- */
/* | (SIDFField) types and constants | */
/* --------------------------------------------------------------------- */
typedef struct /* SIDFField type definition */
{
UINT32 fid;
UINT32 size;
UINT32 control;
void *data;
} SIDFField;
#define FIELD_CTL_NULL_FID 0x00000000
#define FIELD_CTL_FORMAT1 0x00000100
#define FIELD_CTL_FORMAT2 0x00000200
#define FIELD_CTL_FORMAT3 0x00000400
#define FIELD_CTL_VARIABLE_SIZE 0x00000800
#define FIELD_CTL_DATA_IS_HUGE 0x00001000
#define FIELD_CTL_SECTION_BEGIN 0x00002000
#define FIELD_CTL_SECTION_END 0x00004000
#define FIELD_CTL_CALCULATE_CRC 0x00008000
#define FIELD_CTL_WAS_FOUND 0x00010000
#define FIELD_CTL_DATA_IS_UINT16 0x00000001
#define FIELD_CTL_DATA_IS_UINT32 0x00000002
#define FIELD_CTL_DATA_IS_UINT64 0x00000003
#define FIELD_CTL_DATA_IS_STRING 0x00000004
#define FIELD_CTL_DATA_IS_STREAM 0x00000005
#define FIELD_CTL_DATA_IS_TIMESTAMP 0x00000006
#define FIELD_CTL_DATATYPE_MASK 0x000000FF
#define FIELD_CTL_SIZE_FORMATS 0x00000F00
#define FIELD_CTL_FORMAT_HEADER (FIELD_CTL_FORMAT1 | \
FIELD_CTL_SECTION_BEGIN)
#define FIELD_CTL_WRITE_UINT32 (FIELD_CTL_FORMAT1 | \
FIELD_CTL_DATA_IS_UINT32)
#define FIELD_CTL_SMALL_STRING (FIELD_CTL_FORMAT1 | \
FIELD_CTL_DATA_IS_STRING)
/* --------------------------------------------------------------------- */
/* | (SIDFField) macros | */
/* --------------------------------------------------------------------- */
#define SIDF_FieldType(c) ((c) & FIELD_CTL_DATATYPE_MASK)
#define SIDF_ClearFieldType(c) ((c) &= ~FIELD_CTL_DATATYPE_MASK)
#define SIDF_ResetFieldType(c,t) ((c)=((c) & ~FIELD_CTL_DATATYPE_MASK)|t)
#define UINT32SigBytes(n) (((n) & 0xFF000000) ? 4 :\
((n) & 0x00FF0000) ? 3 :\
((n) & 0x0000FF00) ? 2 : 1)
#define SIDF_SizeOfFID(f) UINT32SigBytes(f)
#define SIDF_SizeOfUINT32(n) (((n) & 0xFFFF0000) ? 4 : \
((n) & 0x0000FF00) ? 2 : 1)
#define IsFixedLong(f) (((f) & 0xFFFF0000) && \
(((f) & 0xF000) == 0xF000))
#define IsFixedShort(f) ((((f) & 0xFF000000) == 0) && \
(((f) & 0xC0) == 0x40))
#define LongFixedSz(f) (1 << (((f)&0x700) >> 8))
#define ShortFixedSz(f) (1 << ((f)&0x07))
#define SIDF_GetFixedSize(f) (IsFixedLong(f) ? LongFixedSz(f) : \
IsFixedShort(f) ? ShortFixedSz(f) : 0)
/*
#define SIDF_IsFixedSize(f) ((f&0xFF000000) ? ((f&0xF000) == 0xF000) :\
(!(f&0xFF0000)) ? (f & 0x40) :\
(f & 0x400000) ? (f & 0x40) :\
((f & 0xF000) == 0xF000))
#define SIDF_GetFixedSize(f) ((!(f&0xFFFF0000) || (!(f&0xFF000000) && \
(f&0x400000))) ? (1 << (f&0x07)) : \
(1 << ((f&0x700) >> 8)))
*/
#define SIDF_OffsetToEndSize(c) ((c & FIELD_CTL_DATA_IS_UINT32)? 4 :\
(c & FIELD_CTL_DATA_IS_UINT64)? 8 : 2)
#define SIDF_SizeFormat1(s) ((s) & 0x7F)
#define SIDF_SizeFormat2(s) (((s) & 0xFFFF0000) ? 0x82 : \
((s) & 0x0000FF00) ? 0x81 : 0x80)
#define SIDF_SizeFormat3(d) ((*(BYTE *) (d) | 0xC0))
#endif /* Header Latch */
/***************************************************************************/