home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixtools / unixlib / clib / sys / h / os < prev    next >
Encoding:
Text File  |  1992-07-21  |  3.2 KB  |  108 lines

  1. /* sys/os.h (c) Copyright 1990 H.Rogers */
  2.  
  3. #ifndef __SYS_OS_H
  4. #define __SYS_OS_H
  5.  
  6. typedef struct
  7.   {
  8.   unsigned int    err;
  9.   char        mess[252];
  10.   } os_error;
  11.  
  12. extern    os_error    *os_swi(int,int * /* 10 reg */ );
  13.  
  14. extern    os_error    *os_byte(int,int,int,int * /* 3 reg */ );
  15. extern    os_error    *os_word(int,void *);
  16.  
  17. extern    os_error    *os_print(char *);
  18. extern    os_error    *os_write(char *,int);
  19.  
  20. extern    os_error    *os_cli(char *);
  21.  
  22. extern    os_error    *os_file(int,char *,int * /* 6 reg */ );
  23.  
  24. /* OS_Find */
  25.  
  26. extern    os_error    *os_fopen(int,char *,int * /* 1 reg */ );
  27. extern    os_error    *os_fclose(int);
  28.  
  29. /* OS_GBPB */
  30.  
  31. extern    os_error    *os_fread(int,void *,int,int * /* 5 reg */ );
  32. extern    os_error    *os_fwrite(int,void *,int,int * /* 5 reg */ );
  33.  
  34. extern    os_error    *os_args(int,int,int,int * /* 3 reg */ );
  35.  
  36. extern    os_error    *os_fsctrl(int,char *,char *,int);
  37.  
  38.  
  39. extern void __seterr(os_error *);    /* flag RiscOS error to UNIX */
  40.  
  41.  
  42. /* error flags */
  43.  
  44. #define OS_EHARD(x)    ((x) & 0x80000000)    /* hardware error */
  45. #define OS_EOS(x)    (!((x) & 0x40000000))    /* OS generated */
  46.  
  47. /* error generators */
  48.  
  49. #define OS_EBBC(x) \
  50.     (!((~((x) & 0xff000000))>>8))        /* OS - BBC compatible */
  51. #define OS_EMODULE(x) \
  52.     (((~((x) & 0xff000000))>>5) == 0x08)    /* OS_Module */
  53. #define OS_EVARVAL(x) \
  54.     (((~((x) & 0xff000000))>>5) == 0x09)    /* OS_{Read,Set}VarVal */
  55. #define OS_EREDIR(x) \
  56.     (((~((x) & 0xff000000))>>5) == 0x0a)    /* Redirection Manager */
  57. #define OS_EEVAL(x) \
  58.     (((~((x) & 0xff000000))>>5) == 0x0b)    /* OS_EvaluateExpression */
  59. #define OS_ECLREL(x) \
  60.   (((~((x) & 0xff000000))>>4) >= 0x18 && ((~((x) & 0xff000000))>>4) < 0x1b)
  61.                         /* OS_{Claim,Release} */
  62. #define OS_ECHDYN(x) \
  63.     (((~((x) & 0xff000000))>>4) == 0x1b)    /* OS_ChangeDynamicArea */
  64. #define OS_ECHENV(x) \
  65.     (((~((x) & 0xff000000))>>5) == 0x0e)    /* OS_ChangeEnvironment */
  66. #define OS_EOSCLI(x) \
  67.     (((~((x) & 0xff000000))>>4) == 0x1e)    /* OS_CLI / miscellaneous */
  68.  
  69. #define OS_EFONT(x) \
  70.     (((~((x) & 0xff000000))>>7) == 0x04)    /* font manager */
  71. #define OS_EWIMP(x) \
  72.     (((~((x) & 0xff000000))>>6) == 0x0a)    /* wimp */
  73. #define OS_EDATE(x) \
  74.     (((~((x) & 0xff000000))>>6) == 0x0b)    /* date/time conversion */
  75.  
  76. #define OS_EECONET(x) \
  77.     (((~((x) & 0xff000000))>>8) == 0x03)    /* econet */
  78. #define OS_EFSWITCH(x) \
  79.     (((~((x) & 0xff000000))>>8) == 0x04)    /* fileswitch */
  80. #define OS_EPODULE(x) \
  81.   (((~((x) & 0xff000000))>>4) >= 0x50 && ((~((x) & 0xff000000))>>4) < 0x5c)
  82.                         /* podule */
  83. #define OS_EPRINT(x) \
  84.     (((~((x) & 0xff000000))>>6) == 0x11)    /* printer driver */
  85. #define OS_EMOS(x) \
  86.     (((~((x) & 0xff000000))>>6) == 0x12)    /* misc. OS errors */
  87. #define OS_EINATION(x) \
  88.   (((~((x) & 0xff000000))>>4) >= 0x64 && ((~((x) & 0xff000000))>>4) < 0x70)
  89.                         /* international module */
  90. #define OS_ESPRITE(x) \
  91.     (((~((x) & 0xff000000))>>8) == 0x07)    /* sprites */
  92. #define OS_EDEBUG(x) \
  93.     (((~((x) & 0xff000000))>>8) == 0x08)    /* debugger */
  94.  
  95. #define OS_EFS(x) \
  96.     (((~((x) & 0xff000000))>>16) == 0x1)    /* filing systems */
  97. #define OS_EADFS(x) \
  98.     (((~((x) & 0xff000000))>>8) == 0x108)    /* ADFS specific */
  99.  
  100. #define OS_ESOUND(x) \
  101.     (((~((x) & 0xff000000))>>8) == 0x200)    /* sound */
  102. #define OS_ESCSI(x) \
  103.     (((~((x) & 0xff000000))>>8) == 0x201)    /* SCSI */
  104. #define OS_EVIDEO(x) \
  105.     (((~((x) & 0xff000000))>>8) == 0x202)    /* video */
  106.  
  107. #endif
  108.