stdtypes 3.78 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/* Copyright 1998 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
*
*     STDTYPES.H - Header for standard types
*
*     05-02-92 INH    Original
*
*/

Stewart Brodie's avatar
Stewart Brodie committed
23
#include "DebugLib/DebugLib.h"
24

Stewart Brodie's avatar
Stewart Brodie committed
25 26 27 28
#define debug0(f) dprintf((__FILE__, f))
#define debug1(f,a) dprintf((__FILE__, f,a))
#define debug2(f,a,b) dprintf((__FILE__, f,a,b))
#define debug3(f,a,b,c) dprintf((__FILE__, f,a,b,c))
29 30

/* For RISCOS */
31 32 33 34 35
typedef enum { false, true }    bool;
typedef unsigned char           BYTE;
typedef unsigned short int      WORD;
typedef unsigned int            LONG;
typedef unsigned int            DWORD;
36
typedef unsigned long long      QWORD;
37
typedef int                     err_t;
38 39 40 41 42 43 44 45

#include "sys/types.h"

#define min(a,b)  ((a)<(b) ? (a):(b))
#define max(a,b)  ((a)>(b) ? (a):(b))

/* Return error codes */
#define  OK               0
46
#define  EHOWDTHATHAPPEN  0
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
#define  EBADPARAM        1
#define  ENOCONN          2
#define  EOUTOFMEM        3
#define  ELINKFAILED      4
#define  ENOHANDLES       5
#define  ERXNOTREADY      6
#define  ELINKEXISTS      7
#define  ETIMEOUT         8
#define  ENAMEEXISTS      9
#define  ECANTFINDNAME    10
#define  EDATALEN         11

/* SMB errors */
#define  ESERVERROR       12
#define  EDOSERROR        13
#define  EHARDERROR       14
#define  EPROTOCOLERR     15
#define  ENOMOREFILES     16
#define  EFILENOTFOUND    17
#define  EPATHNOTFOUND    18
#define  ENOFHANDLES      19
#define  ENOACCESS        20
#define  EFILEEXISTS      21
#define  EBADPASSWD       22
#define  EBADNAME         23
#define  EBADDRV          24
#define  ENORISCOS2       25
#define  ENOGBPB          26
#define  ENOUNBUFF        27
#define  ENOTINSTALLED    28
#define  ENOTPRESENT      29
#define  ENOWILDCARD      30
#define  EATTRIBREAD      31
#define  EATTRIBWRITE     32
#define  ESHARING         33
#define  ECONNLIMIT       34
#define  ENOSUCHSHARE     35

/* Installation errors */
#define  ECMDLINE         36
#define  ERISCOSVER       37
#define  EINITFAILED      38
#define  EDRIVERNAME      39
#define  EDRIVERTYPE      40
#define  EDRIVERVER       41

#define  ECONNEXISTS      42
#define  EPACKETTYPE      43
#define  EMBUFMODULE      44

#define  ERPCERROR        45
98
#define  EDISCFULL        46
99 100 101 102 103 104 105 106 107 108 109 110
#define  EDIRNOTEMPTY     47
#define  EBADRENAME       48
#define  EFILEHANDLE      49

/* NetBIOS-over-IP errors */
#define  ECREATESOCKET    50
#define  ECONNECTSOCKET   51
#define  ECONNREJECT      52
#define  ERETARGET        53
#define  ENOIFADDR        54
#define  ENOSOCKETS       55

111
/* More errors */
112 113 114 115 116 117
#define  EBOOTREENTRY     56
#define  EBOOTERROR       57
#define  EHOMEDIRNAME     58
#define  EHOMEDIRCONN     59
#define  EUSERUNKNOWN     60
#define  EACCDISABLED     61
Stewart Brodie's avatar
Stewart Brodie committed
118
#define  ELANMANFSINUSE   62
119

Robert Sprowson's avatar
Robert Sprowson committed
120
#define  EUSELASTSETOSERR 0x10000 /* Signifies non-LanMan error */
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139

#define  OPEN_READ        0
#define  OPEN_WRITE       1
#define  OPEN_READWRITE   2

/* DOS attributes */
#define ATTR_NORM 0
#define ATTR_RO   1
#define ATTR_HID  2
#define ATTR_SYS  4
#define ATTR_VOL  8
#define ATTR_DIR  0x10
#define ATTR_ARC  0x20

typedef struct
{
  int  attr;
  uint utime;
  int  length;
Stewart Brodie's avatar
Stewart Brodie committed
140
  int  riscos_type;
141
} DOS_ATTRIBS;
142 143

/* RISCOS attributes */
Stewart Brodie's avatar
Stewart Brodie committed
144
#define ROA_READ   ((1<<0) | (1<<4))
145 146 147 148 149 150 151 152
#define ROA_WRITE  2
#define ROA_LOCKED 8

typedef struct
{
  uint  loadaddr;
  uint  execaddr;
  uint  flags;
153
} RISCOS_ATTRIBS;