|
|
// ===========================================================================
// UAMUtils.h � 1997 Microsoft Corp. All rights reserved.
// ===========================================================================
#pragma once
#include "ClientUAM.h"
#define PSTR_DEFAULT_WORKSTATION_NAME "\pMacintosh"
#define STR_ChooserUserName -16096 //User name set in sharing setup
#define STR_Sys7WorkStationName -16413 //Workstation (computer) name set in sharing setup
#define PSTR_LENGTH(s) s[0]
//
//This macro "does the right thing" when calling any callback functions. The method
//for calling these fuctions is different depending on what platform we're building
//for.
//
#if defined(UAM_TARGET_PPC) && !defined(UAM_TARGET_CARBON)
#define UAM_CALLBACK_ONEPARAM(procPtr, procInfo, param) \
CallUniversalProc(procPtr, procInfo, param)
#define UAM_CALLBACK_TWOPARAM(procPtr, procInfo, param1, param2) \
CallUniversalProc(procPtr, procInfo, param1, param2)
#define UAM_CALLBACK_THREEPARAM(procPtr, procInfo, param1, param2, param3) \
CallUniversalProc(procPtr, procInfo, param1, param2, param3)
#else //Must be Carbon PPC or 68K
#define UAM_CALLBACK_ONEPARAM(procPtr, procInfo, param) \
procPtr(param)
#define UAM_CALLBACK_TWOPARAM(procPtr, procInfo, param1, param2) \
procPtr(param1, param2)
#define UAM_CALLBACK_THREEPARAM(procPtr, procInfo, param1, param2, param3) \
procPtr(param1, param2, param3)
#endif
//
//In carbon, c2pstr and p2cstr are not defined. So these macros help
//us go between carbon and Mac68K.
//
#ifdef UAM_TARGET_CARBON
#define _c2pstr(c) UAM_CToPStr(c)
#define _p2cstr(p) UAM_PToCStr(p)
#else
#define _c2pstr(c) c2pstr(c)
#define _p2cstr(p) p2cstr(p)
#endif
//
//Some help with the differences in OT from Classic to Carbon
//
#ifdef UAM_TARGET_CARBON
#define UAMInitOpenTransport(flags,cntx) InitOpenTransportInContext(flags, cntx);
#define UAMCloseOpenTransport(cntx) CloseOpenTransportInContext(cntx);
#define UAMOTOpenEndpoint(config,oflag,info,err) OTOpenEndpointInContext(config,oflag,info,err,NULL);
#else
#define UAMInitOpenTransport(flags,cntx) InitOpenTransport();
#define UAMCloseOpenTransport(cntx) CloseOpenTransport();
#define UAMOTOpenEndpoint(config,oflag,info,err) OTOpenEndpoint(config,oflag,info,err);
#endif
#define _min(a,b) (((a) < (b)) ? (a) : (b))
#define _max(a,b) (((a) > (b)) ? (a) : (b))
//
//Help with bitmaps...
//
#define BIT_0 0x1
#define BIT_1 0x2
#define BIT_2 0x4
#define BIT_3 0x8
#define BIT_4 0x10
#define BIT_5 0x20
#define BIT_6 0x40
#define BIT_7 0x80
#define BIT_8 0x100
//
//Some keycodes in keymap form
//
#define KEY_Shift 0x38
#define KEY_Command 0x37
#define KEY_Option 0x3A
#define KEY_Control 0x3B
//
//Event key code types.
//
#define UAMKey_Home 0x01
#define UAMKey_Enter 0x03
#define UAMKey_End 0x04
#define UAMKey_PageUp 0x0B
#define UAMKey_PageDown 0x0C
#define UAMKey_BackDel 0x08
#define UAMKey_Tab 0x09
#define UAMKey_Escape 0x1b
#define UAMKey_Left 0x1c
#define UAMKey_Right 0x1d
#define UAMKey_Up 0x1e
#define UAMKey_Down 0x1f
#define UAMKey_Return 0x0d
#define UAMKey_Space 0x20
#define UAMKey_FirstExtended 0x80
#define UAMKey_FwdDel 0x7f
#define UAMKey_Period '.'
//
//Struct for accessing server info after a ASPGetStatus call. This is the
//header information provided from the call. See Inside Appletalk p. 13-95/97
//
typedef struct
{
short machineTypeOffset;
short afpVersionOffset;
short supportedUAMOffset;
short volumeIconOffset;
short serverFlags;
}ServerInfoReplyBlock, *ServerInfoReplyBlockP;
#ifdef UAM_TARGET_CARBON
struct AFPSrvrInfo {
short fMachineOffset;
short fVerCountOffset;
short fUAMCountOffset;
short fIconOffset;
short fFlags;
unsigned char fSrvrName[2];
};
typedef struct AFPSrvrInfo AFPSrvrInfo;
#endif
//
//Enums for supported UAMs on the server.
//
enum {
kGuestSupported = 0x1,
kClearTxtSupporte
|