home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / m2posx14 / src / lcposix.ipp < prev    next >
Encoding:
Modula Implementation  |  1994-05-27  |  27.0 KB  |  880 lines

  1. IMPLEMENTATION MODULE LCPOSIX;
  2. __IMP_SWITCHES__
  3. __DEBUG__
  4. #ifdef HM2
  5. #ifdef __LONG_WHOLE__
  6. (*$!i+: Modul muss mit $i- uebersetzt werden! *)
  7. (*$!w+: Modul muss mit $w- uebersetzt werden! *)
  8. #else
  9. (*$!i-: Modul muss mit $i+ uebersetzt werden! *)
  10. (*$!w-: Modul muss mit $w+ uebersetzt werden! *)
  11. #endif
  12. #endif
  13. (****************************************************************************)
  14. (* 27-Mai-94, Holger Kleinschmidt                                           *)
  15. (****************************************************************************)
  16.  
  17. FROM SYSTEM IMPORT
  18. (* PROC *) ADR;
  19. #if (defined MM2)
  20. FROM SYSTEM IMPORT CADR;
  21. #endif
  22.  
  23. FROM PORTAB IMPORT
  24. (* TYPE *) UNSIGNEDWORD, SIGNEDWORD;
  25.  
  26. FROM types IMPORT
  27. (* TYPE *) StrPtr;
  28.  
  29. FROM LCTypes IMPORT
  30. (* TYPE *) LCTime, LCNumeric, LCMonetary, LCCtype, LCMessages,
  31.            LCTimeP, LCNumericP, LCMonetaryP, LCCtypeP, LCMessagesP,
  32.            CType, CClass, CClasses, CTrans;
  33.  
  34. (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*)
  35.  
  36. TYPE
  37.   Vtime = RECORD
  38.     Vabday     : ARRAY [0..6]  OF ARRAY [0..3] OF CHAR;
  39.     Vday       : ARRAY [0..6]  OF ARRAY [0..9] OF CHAR;
  40.     Vabmon     : ARRAY [0..11] OF ARRAY [0..3] OF CHAR;
  41.     Vmon       : ARRAY [0..11] OF ARRAY [0..9] OF CHAR;
  42.     Vampm      : ARRAY [0..1]  OF ARRAY [0..2] OF CHAR;
  43.     Vdtfmt     : ARRAY [0..20] OF CHAR;
  44.     Vdfmt      : ARRAY [0..3]  OF CHAR;
  45.     Vtfmt      : ARRAY [0..3]  OF CHAR;
  46.     Vtfmtampm  : ARRAY [0..3]  OF CHAR;
  47.   END;
  48.  
  49. TYPE
  50.   Vbioserr    = ARRAY [0..19] OF ARRAY [0..21] OF CHAR;
  51.   Vgemdoserr  = ARRAY [0..16] OF ARRAY [0..27] OF CHAR;
  52.   Vminterr    = ARRAY [0..1]  OF ARRAY [0..23] OF CHAR;
  53.   Vsocketerr  = ARRAY [0..26] OF ARRAY [0..40] OF CHAR;
  54.   Vposixerr   = ARRAY [0..15] OF ARRAY [0..23] OF CHAR;
  55.   Vsignal     = ARRAY [0..30] OF ARRAY [0..31] OF CHAR;
  56.   Vunknownerr = ARRAY [0..13] OF CHAR;
  57.   Vunknownsig = ARRAY [0..14] OF CHAR;
  58.  
  59. #if ISO_value_constructor && (defined MM2)
  60. CONST
  61.  vtime = Vtime{
  62.    {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"},
  63.    {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"},
  64.    {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},
  65.    {"January","February","March","April","May","June","July",
  66.     "August","September","October","November","December"},
  67.    {"AM","PM"},
  68.    "%a %b %e %H:%M:%S %y",
  69.    "%D",  (* <=> "%m/%d/%y" *)
  70.    "%T",  (* <=> "%H:%M:%S" *)
  71.    "%r"   (* <=> "%I:%M:%S %p" *)
  72.  };
  73. #else
  74. VAR
  75.   vtime : Vtime;
  76. #endif
  77.  
  78. VAR
  79.   uerr : Vunknownerr;
  80.   usig : Vunknownsig;
  81.  
  82. #if ISO_value_constructor && (defined HM2)
  83. CONST
  84.  vctype = LCCtype{
  85.    CClasses{
  86.      CClass{IScntrl}                                          BY 9,
  87.      CClass{IScntrl,ISspace,ISblank}                          BY 1,
  88.      CClass{IScntrl,ISspace}                                  BY 4,
  89.      CClass{IScntrl}                                          BY 18,
  90.      CClass{ISspace,ISblank,ISprint}                          BY 1,
  91.      CClass{ISpunct,ISgraph,ISprint}                          BY 15,
  92.      CClass{ISdigit,ISxdigit,ISalnum,ISgraph,ISprint}         BY 10,
  93.      CClass{ISpunct,ISgraph,ISprint}                          BY 7,
  94.      CClass{ISxdigit,ISupper,ISalpha,ISalnum,ISgraph,ISprint} BY 6,
  95.      CClass{ISupper,ISalpha,ISalnum,ISgraph,ISprint}          BY 20,
  96.      CClass{ISpunct,ISgraph,ISprint}                          BY 6,
  97.      CClass{ISxdigit,ISlower,ISalpha,ISalnum,ISgraph,ISprint} BY 6,
  98.      CClass{ISlower,ISalpha,ISalnum,ISgraph,ISprint}          BY 20,
  99.      CClass{ISpunct,ISgraph,ISprint}                          BY 4,
  100.      CClass{IScntrl}                                          BY 1,
  101.      CClass{}                                                 BY 128
  102.    },
  103.    CTrans{
  104.      0C,1C,2C,3C,4C,5C,6C,7C,10C,11C,
  105.      12C,13C,14C,15C,16C,17C,20C,21C,22C,23C,
  106.      24C,25C,26C,27C,30C,31C,32C,33C,34C,35C,
  107.      36C,37C,40C,41C,42C,43C,44C,45C,46C,47C,
  108.      50C,51C,52C,53C,54C,55C,56C,57C,60C,61C,
  109.      62C,63C,64C,65C,66C,67C,70C,71C,72C,73C,
  110.      74C,75C,76C,77C,100C,101C,102C,103C,104C,105C,
  111.      106C,107C,110C,111C,112C,113C,114C,115C,116C,117C,
  112.      120C,121C,122C,123C,124C,125C,126C,127C,130C,131C,
  113.      132C,133C,134C,135C,136C,137C,140C,101C,102C,103C,
  114.      104C,105C,106C,107C,110C,111C,112C,113C,114C,115C,
  115.      116C,117C,120C,121C,122C,123C,124C,125C,126C,127C,
  116.      130C,131C,132C,173C,174C,175C,176C,177C,200C,201C,
  117.      202C,203C,204C,205C,206C,207C,210C,211C,212C,213C,
  118.      214C,215C,216C,217C,220C,221C,222C,223C,224C,225C,
  119.      226C,227C,230C,231C,232C,233C,234C,235C,236C,237C,
  120.      240C,241C,242C,243C,244C,245C,246C,247C,250C,251C,
  121.      252C,253C,254C,255C,256C,257C,260C,261C,262C,263C,
  122.      264C,265C,266C,267C,270C,271C,272C,273C,274C,275C,
  123.      276C,277C,300C,301C,302C,303C,304C,305C,306C,307C,
  124.      310C,311C,312C,313C,314C,315C,316C,317C,320C,321C,
  125.      322C,323C,324C,325C,326C,327C,330C,331C,332C,333C,
  126.      334C,335C,336C,337C,340C,341C,342C,343C,344C,345C,
  127.      346C,347C,350C,351C,352C,353C,354C,355C,356C,357C,
  128.      360C,361C,362C,363C,364C,365C,366C,367C,370C,371C,
  129.      372C,373C,374C,375C,376C,377C
  130.    },
  131.    CTrans{
  132.      0C,1C,2C,3C,4C,5C,6C,7C,10C,11C,
  133.      12C,13C,14C,15C,16C,17C,20C,21C,22C,23C,
  134.      24C,25C,26C,27C,30C,31C,32C,33C,34C,35C,
  135.      36C,37C,40C,41C,42C,43C,44C,45C,46C,47C,
  136.      50C,51C,52C,53C,54C,55C,56C,57C,60C,61C,
  137.      62C,63C,64C,65C,66C,67C,70C,71C,72C,73C,
  138.      74C,75C,76C,77C,100C,141C,142C,143C,144C,145C,
  139.      146C,147C,150C,151C,152C,153C,154C,155C,156C,157C,
  140.      160C,161C,162C,163C,164C,165C,166C,167C,170C,171C,
  141.      172C,133C,134C,135C,136C,137C,140C,141C,142C,143C,
  142.      144C,145C,146C,147C,150C,151C,152C,153C,154C,155C,
  143.      156C,157C,160C,161C,162C,163C,164C,165C,166C,167C,
  144.      170C,171C,172C,173C,174C,175C,176C,177C,200C,201C,
  145.      202C,203C,204C,205C,206C,207C,210C,211C,212C,213C,
  146.      214C,215C,216C,217C,220C,221C,222C,223C,224C,225C,
  147.      226C,227C,230C,231C,232C,233C,234C,235C,236C,237C,
  148.      240C,241C,242C,243C,244C,245C,246C,247C,250C,251C,
  149.      252C,253C,254C,255C,256C,257C,260C,261C,262C,263C,
  150.      264C,265C,266C,267C,270C,271C,272C,273C,274C,275C,
  151.      276C,277C,300C,301C,302C,303C,304C,305C,306C,307C,
  152.      310C,311C,312C,313C,314C,315C,316C,317C,320C,321C,
  153.      322C,323C,324C,325C,326C,327C,330C,331C,332C,333C,
  154.      334C,335C,336C,337C,340C,341C,342C,343C,344C,345C,
  155.      346C,347C,350C,351C,352C,353C,354C,355C,356C,357C,
  156.      360C,361C,362C,363C,364C,365C,366C,367C,370C,371C,
  157.      372C,373C,374C,375C,376C,377C
  158.    }
  159.  };
  160.  
  161.  bios = Vbioserr{
  162.    "OK",
  163.    "Error",
  164.    "Device not ready",
  165.    "Unknown command",
  166.    "Crc error",
  167.    "Bad request",
  168.    "Seek error",
  169.    "Unknown media",
  170.    "Sector not found",
  171.    "Out of paper",
  172.    "Write failure",
  173.    "Read failure",
  174.    "General error",
  175.    "Write protected",
  176.    "Media changed",
  177.    "Unknown device",
  178.    "Bad sectors found",
  179.    "Another disk",
  180.    "Insert media!",
  181.    "Device not responding"
  182.  };
  183.  gemdos = Vgemdoserr{
  184.    "Invalid function number",
  185.    "File not found",
  186.    "Path not found",
  187.    "No more handles",
  188.    "Access denied",
  189.    "Invalid handle",
  190.    "Out of memory",
  191.    "Invalid memory block",
  192.    "Invalid drive",
  193.    "Different drives",
  194.    "No more files",
  195.    "File locked",
  196.    "Invalid lock",
  197.    "Range error",
  198.    "Internal error",
  199.    "Not executable",
  200.    "Memory block growth failure"
  201.  };
  202.  mint = Vminterr{
  203.    "Too many symbolic links",
  204.    "Broken pipe"
  205.  };
  206.  socket = Vsocketerr{
  207.    "Socket operation on non-socket",
  208.    "Destination address required",
  209.    "Message too long",
  210.    "Protocol wrong type for socket",
  211.    "Protocol not available",
  212.    "Protocol not supported",
  213.    "Socket type not supported",
  214.    "Operation not supported",
  215.    "Protocol family not supported",
  216.    "Address family not supported by protocol",
  217.    "Address already in use",
  218.    "Cannot assign requested address",
  219.    "Network is down",
  220.    "Network is unreachable",
  221.    "Network dropped conn. because of reset",
  222.    "Software caused connection abort",
  223.    "Connection reset by peer",
  224.    "Socket is already connected",
  225.    "Socket is not connected",
  226.    "Cannot send after shutdown",
  227.    "Connection timed out",
  228.    "Connection refused",
  229.    "Host is down",
  230.    "No route to host",
  231.    "Operation already in progress",
  232.    "Operation now in progress",
  233.    "Operation would block"
  234.  };
  235.  posix = Vposixerr{
  236.    "Interrupted by signal",
  237.    "Resource unavailable",
  238.    "Deadlock would result",
  239.    "Invalid argument",
  240.    "File exists",
  241.    "File too large",
  242.    "Argument list too long",
  243.    "Is a directory",
  244.    "Too many links",
  245.    "Filename too long",
  246.    "No locks available",
  247.    "No space left on device",
  248.    "Directory not empty",
  249.    "Wrong i/o control op",
  250.    "Result too large",
  251.    "Invalid seek"
  252.  };
  253.  signal = Vsignal{
  254.    "No signal",
  255.    "Hangup",
  256.    "Interrupt",
  257.    "Quit",
  258.    "Illegal instruction",
  259.    "Trace trap",
  260.    "Abort",
  261.    "Privilege violation",
  262.    "Floating point exception",
  263.    "Killed",
  264.    "Bus error",
  265.    "Segmentation fault",
  266.    "Bad argument to system call",
  267.    "Broken pipe",
  268.    "Alarm clock",
  269.    "Terminated",
  270.    "Urgent condition on I/O channel",
  271.    "Stopped (signal)",
  272.    "Stopped",
  273.    "Continued",
  274.    "Child process exited",
  275.    "Stopped (tty input)",
  276.    "Stopped (tty output)",
  277.    "I/O possible",
  278.    "CPU limit exceeded",
  279.    "File size limit exceeded",
  280.    "Virtual timer alarm",
  281.    "Profiling signal",
  282.    "Window system signal",
  283.    "User-defined signal 1",
  284.    "User-defined signal 2"
  285.  };
  286. #else
  287. VAR
  288.   vctype : LCCtype;
  289.   bios   : Vbioserr;
  290.   gemdos : Vgemdoserr;
  291.   mint   : Vminterr;
  292.   socket : Vsocketerr;
  293.   posix  : Vposixerr;
  294.   signal : Vsignal;
  295. #endif
  296.  
  297. VAR
  298.   time      : LCTime;
  299.   vmonetary : LCMonetary;
  300.   vnumeric  : LCNumeric;
  301.   messages  : LCMessages;
  302.  
  303. VAR
  304.   Vpoint    : ARRAY [0..1] OF CHAR;
  305.   Vpointadr : StrPtr;
  306.  
  307. VAR
  308.   Vnull    : CHAR;
  309.   Vnulladr : StrPtr;
  310.  
  311. VAR
  312.   i : UNSIGNEDWORD;
  313.   c : CHAR;
  314.  
  315. BEGIN
  316.  Vpoint    := ".";
  317.  Vnull     := 0C;
  318.  Vpointadr := ADR(Vpoint);
  319.  Vnulladr  := ADR(Vnull);
  320.  
  321. #if ISO_value_constructor
  322.  vnumeric := LCNumeric{Vpointadr,Vnulladr,Vnulladr};
  323. #else
  324.  WITH vnumeric DO
  325.    decimalpoint := Vpointadr;
  326.    thousandssep := Vnulladr;
  327.    grouping     := Vnulladr;
  328.  END;
  329. #endif
  330.  Numeric := ADR(vnumeric);
  331.  
  332. #if ISO_value_constructor
  333.  vmonetary := LCMonetary{Vnulladr,Vnulladr,Vnulladr,Vnulladr,Vnulladr,
  334.                          Vnulladr,Vnulladr, -1,-1,-1,-1,-1,-1,-1,-1};
  335. #else
  336.  WITH vmonetary DO
  337.    intcurrsymbol   := Vnulladr;
  338.    currencysymbol  := Vnulladr;
  339.    mondecimalpoint := Vnulladr;
  340.    monthousandssep := Vnulladr;
  341.    mongrouping     := Vnulladr;
  342.    positivesign    := Vnulladr;
  343.    negativesign    := Vnulladr;
  344.  
  345.    intfracdigits   := -1;
  346.    fracdigits      := -1;
  347.    pcsprecedes     := -1;
  348.    psepbyspace     := -1;
  349.    ncsprecedes     := -1;
  350.    nsepbyspace     := -1;
  351.    psignposn       := -1;
  352.    nsignposn       := -1;
  353.  END;
  354. #endif
  355.  Monetary := ADR(vmonetary);
  356.  
  357. #if !(ISO_value_constructor && (defined MM2))
  358. #if ISO_value_constructor
  359.  vtime := Vtime{
  360.    {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"},
  361.    {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"},
  362.    {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},
  363.    {"January","February","March","April","May","June","July","August",
  364.     "September","October","November","December"},
  365.    {"AM","PM"},
  366.    "%a %b %e %H:%M:%S %y",
  367.    "%D",  (* <=> "%m/%d/%y" *)
  368.    "%T",  (* <=> "%H:%M:%S" *)
  369.    "%r"   (* <=> "%I:%M:%S %p" *)
  370.  };
  371. #else
  372.  WITH vtime DO
  373.    Vabday[0]  := "Sun";
  374.    Vabday[1]  := "Mon";
  375.    Vabday[2]  := "Tue";
  376.    Vabday[3]  := "Wed";
  377.    Vabday[4]  := "Thu";
  378.    Vabday[5]  := "Fri";
  379.    Vabday[6]  := "Sat";
  380.    Vday[0]    := "Sunday";
  381.    Vday[1]    := "Monday";
  382.    Vday[2]    := "Tuesday";
  383.    Vday[3]    := "Wednesday";
  384.    Vday[4]    := "Thursday";
  385.    Vday[5]    := "Friday";
  386.    Vday[6]    := "Saturday";
  387.    Vabmon[0]  := "Jan";
  388.    Vabmon[1]  := "Feb";
  389.    Vabmon[2]  := "Mar";
  390.    Vabmon[3]  := "Apr";
  391.    Vabmon[4]  := "May";
  392.    Vabmon[5]  := "Jun";
  393.    Vabmon[6]  := "Jul";
  394.    Vabmon[7]  := "Aug";
  395.    Vabmon[8]  := "Sep";
  396.    Vabmon[9]  := "Oct";
  397.    Vabmon[10] := "Nov";
  398.    Vabmon[11] := "Dec";
  399.    Vmon[0]    := "January";
  400.    Vmon[1]    := "February";
  401.    Vmon[2]    := "March";
  402.    Vmon[3]    := "April";
  403.    Vmon[4]    := "May";
  404.    Vmon[5]    := "June";
  405.    Vmon[6]    := "July";
  406.    Vmon[7]    := "August";
  407.    Vmon[8]    := "September";
  408.    Vmon[9]    := "October";
  409.    Vmon[10]   := "November";
  410.    Vmon[11]   := "December";
  411.    Vampm[0]   := "AM";
  412.    Vampm[1]   := "PM";
  413.    Vdtfmt     := "%a %b %e %H:%M:%S %Y";
  414.    Vdfmt      := "%D";
  415.    Vtfmt      := "%T";
  416.    Vtfmtampm  := "%r";
  417.  END;
  418. #endif
  419. #endif
  420.  
  421.  WITH time DO
  422.    FOR i := 0 TO 6 DO
  423.      abday[i] := CADR(vtime.Vabday[i]);
  424.      day[i]   := CADR(vtime.Vday[i]);
  425.    END;
  426.    FOR i := 0 TO 11 DO
  427.      abmon[i] := CADR(vtime.Vabmon[i]);
  428.      mon[i]   := CADR(vtime.Vmon[i]);
  429.    END;
  430.    ampm[0]  := CADR(vtime.Vampm[0]);
  431.    ampm[1]  := CADR(vtime.Vampm[1]);
  432.    dtfmt    := CADR(vtime.Vdtfmt);
  433.    dfmt     := CADR(vtime.Vdfmt);
  434.    tfmt     := CADR(vtime.Vtfmt);
  435.    tfmtampm := CADR(vtime.Vtfmtampm);
  436.  END;
  437.  Time := ADR(time);
  438.  
  439.  uerr := "Unknown error";
  440.  usig := "Unknown signal";
  441.  
  442. #if !(ISO_value_constructor && (defined HM2))
  443. #if ISO_value_constructor
  444.  vctype := LCCtype{
  445.    CClasses{
  446.      CClass{IScntrl}                                          BY 9,
  447.      CClass{IScntrl,ISspace,ISblank}                          BY 1,
  448.      CClass{IScntrl,ISspace}                                  BY 4,
  449.      CClass{IScntrl}                                          BY 18,
  450.      CClass{ISspace,ISblank,ISprint}                          BY 1,
  451.      CClass{ISpunct,ISgraph,ISprint}                          BY 15,
  452.      CClass{ISdigit,ISxdigit,ISalnum,ISgraph,ISprint}         BY 10,
  453.      CClass{ISpunct,ISgraph,ISprint}                          BY 7,
  454.      CClass{ISxdigit,ISupper,ISalpha,ISalnum,ISgraph,ISprint} BY 6,
  455.      CClass{ISupper,ISalpha,ISalnum,ISgraph,ISprint}          BY 20,
  456.      CClass{ISpunct,ISgraph,ISprint}                          BY 6,
  457.      CClass{ISxdigit,ISlower,ISalpha,ISalnum,ISgraph,ISprint} BY 6,
  458.      CClass{ISlower,ISalpha,ISalnum,ISgraph,ISprint}          BY 20,
  459.      CClass{ISpunct,ISgraph,ISprint}                          BY 4,
  460.      CClass{IScntrl}                                          BY 1,
  461.      CClass{}                                                 BY 128
  462.    },
  463.    CTrans{
  464.      0C,1C,2C,3C,4C,5C,6C,7C,10C,11C,
  465.      12C,13C,14C,15C,16C,17C,20C,21C,22C,23C,
  466.      24C,25C,26C,27C,30C,31C,32C,33C,34C,35C,
  467.      36C,37C,40C,41C,42C,43C,44C,45C,46C,47C,
  468.      50C,51C,52C,53C,54C,55C,56C,57C,60C,61C,
  469.      62C,63C,64C,65C,66C,67C,70C,71C,72C,73C,
  470.      74C,75C,76C,77C,100C,101C,102C,103C,104C,105C,
  471.      106C,107C,110C,111C,112C,113C,114C,115C,116C,117C,
  472.      120C,121C,122C,123C,124C,125C,126C,127C,130C,131C,
  473.      132C,133C,134C,135C,136C,137C,140C,101C,102C,103C,
  474.      104C,105C,106C,107C,110C,111C,112C,113C,114C,115C,
  475.      116C,117C,120C,121C,122C,123C,124C,125C,126C,127C,
  476.      130C,131C,132C,173C,174C,175C,176C,177C,200C,201C,
  477.      202C,203C,204C,205C,206C,207C,210C,211C,212C,213C,
  478.      214C,215C,216C,217C,220C,221C,222C,223C,224C,225C,
  479.      226C,227C,230C,231C,232C,233C,234C,235C,236C,237C,
  480.      240C,241C,242C,243C,244C,245C,246C,247C,250C,251C,
  481.      252C,253C,254C,255C,256C,257C,260C,261C,262C,263C,
  482.      264C,265C,266C,267C,270C,271C,272C,273C,274C,275C,
  483.      276C,277C,300C,301C,302C,303C,304C,305C,306C,307C,
  484.      310C,311C,312C,313C,314C,315C,316C,317C,320C,321C,
  485.      322C,323C,324C,325C,326C,327C,330C,331C,332C,333C,
  486.      334C,335C,336C,337C,340C,341C,342C,343C,344C,345C,
  487.      346C,347C,350C,351C,352C,353C,354C,355C,356C,357C,
  488.      360C,361C,362C,363C,364C,365C,366C,367C,370C,371C,
  489.      372C,373C,374C,375C,376C,377C
  490.    },
  491.    CTrans{
  492.      0C,1C,2C,3C,4C,5C,6C,7C,10C,11C,
  493.      12C,13C,14C,15C,16C,17C,20C,21C,22C,23C,
  494.      24C,25C,26C,27C,30C,31C,32C,33C,34C,35C,
  495.      36C,37C,40C,41C,42C,43C,44C,45C,46C,47C,
  496.      50C,51C,52C,53C,54C,55C,56C,57C,60C,61C,
  497.      62C,63C,64C,65C,66C,67C,70C,71C,72C,73C,
  498.      74C,75C,76C,77C,100C,141C,142C,143C,144C,145C,
  499.      146C,147C,150C,151C,152C,153C,154C,155C,156C,157C,
  500.      160C,161C,162C,163C,164C,165C,166C,167C,170C,171C,
  501.      172C,133C,134C,135C,136C,137C,140C,141C,142C,143C,
  502.      144C,145C,146C,147C,150C,151C,152C,153C,154C,155C,
  503.      156C,157C,160C,161C,162C,163C,164C,165C,166C,167C,
  504.      170C,171C,172C,173C,174C,175C,176C,177C,200C,201C,
  505.      202C,203C,204C,205C,206C,207C,210C,211C,212C,213C,
  506.      214C,215C,216C,217C,220C,221C,222C,223C,224C,225C,
  507.      226C,227C,230C,231C,232C,233C,234C,235C,236C,237C,
  508.      240C,241C,242C,243C,244C,245C,246C,247C,250C,251C,
  509.      252C,253C,254C,255C,256C,257C,260C,261C,262C,263C,
  510.      264C,265C,266C,267C,270C,271C,272C,273C,274C,275C,
  511.      276C,277C,300C,301C,302C,303C,304C,305C,306C,307C,
  512.      310C,311C,312C,313C,314C,315C,316C,317C,320C,321C,
  513.      322C,323C,324C,325C,326C,327C,330C,331C,332C,333C,
  514.      334C,335C,336C,337C,340C,341C,342C,343C,344C,345C,
  515.      346C,347C,350C,351C,352C,353C,354C,355C,356C,357C,
  516.      360C,361C,362C,363C,364C,365C,366C,367C,370C,371C,
  517.      372C,373C,374C,375C,376C,377C
  518.    }
  519.  };
  520.  
  521.  bios := Vbioserr{
  522.    "OK",
  523.    "Error",
  524.    "Device not ready",
  525.    "Unknown command",
  526.    "Crc error",
  527.    "Bad request",
  528.    "Seek error",
  529.    "Unknown media",
  530.    "Sector not found",
  531.    "Out of paper",
  532.    "Write failure",
  533.    "Read failure",
  534.    "General error",
  535.    "Write protected",
  536.    "Media changed",
  537.    "Unknown device",
  538.    "Bad sectors found",
  539.    "Another disk",
  540.    "Insert media!",
  541.    "Device not responding"
  542.  };
  543.  gemdos := Vgemdoserr{
  544.    "Invalid function number",
  545.    "File not found",
  546.    "Path not found",
  547.    "No more handles",
  548.    "Access denied",
  549.    "Invalid handle",
  550.    "Out of memory",
  551.    "Invalid memory block",
  552.    "Invalid drive",
  553.    "Different drives",
  554.    "No more files",
  555.    "File locked",
  556.    "Invalid lock",
  557.    "Range error",
  558.    "Internal error",
  559.    "Not executable",
  560.    "Memory block growth failure"
  561.  };
  562.  mint := Vminterr{
  563.    "Too many symbolic links",
  564.    "Broken pipe"
  565.  };
  566.  socket := Vsocketerr{
  567.    "Socket operation on non-socket",
  568.    "Destination address required",
  569.    "Message too long",
  570.    "Protocol wrong type for socket",
  571.    "Protocol not available",
  572.    "Protocol not supported",
  573.    "Socket type not supported",
  574.    "Operation not supported",
  575.    "Protocol family not supported",
  576.    "Address family not supported by protocol",
  577.    "Address already in use",
  578.    "Cannot assign requested address",
  579.    "Network is down",
  580.    "Network is unreachable",
  581.    "Network dropped conn. because of reset",
  582.    "Software caused connection abort",
  583.    "Connection reset by peer",
  584.    "Socket is already connected",
  585.    "Socket is not connected",
  586.    "Cannot send after shutdown",
  587.    "Connection timed out",
  588.    "Connection refused",
  589.    "Host is down",
  590.    "No route to host",
  591.    "Operation already in progress",
  592.    "Operation now in progress",
  593.    "Operation would block"
  594.  };
  595.  posix := Vposixerr{
  596.    "Interrupted by signal",
  597.    "Resource unavailable",
  598.    "Deadlock would result",
  599.    "Invalid argument",
  600.    "File exists",
  601.    "File too large",
  602.    "Argument list too long",
  603.    "Is a directory",
  604.    "Too many links",
  605.    "Filename too long",
  606.    "No locks available",
  607.    "No space left on device",
  608.    "Directory not empty",
  609.    "Wrong i/o control op",
  610.    "Result too large",
  611.    "Invalid seek"
  612.  };
  613.  signal := Vsignal{
  614.    "No signal",
  615.    "Hangup",
  616.    "Interrupt",
  617.    "Quit",
  618.    "Illegal instruction",
  619.    "Trace trap",
  620.    "Abort",
  621.    "Privilege violation",
  622.    "Floating point exception",
  623.    "Killed",
  624.    "Bus error",
  625.    "Segmentation fault",
  626.    "Bad argument to system call",
  627.    "Broken pipe",
  628.    "Alarm clock",
  629.    "Terminated",
  630.    "Urgent condition on I/O channel",
  631.    "Stopped (signal)",
  632.    "Stopped",
  633.    "Continued",
  634.    "Child process exited",
  635.    "Stopped (tty input)",
  636.    "Stopped (tty output)",
  637.    "I/O possible",
  638.    "CPU limit exceeded",
  639.    "File size limit exceeded",
  640.    "Virtual timer alarm",
  641.    "Profiling signal",
  642.    "Window system signal",
  643.    "User-defined signal 1",
  644.    "User-defined signal 2"
  645.  };
  646. #else
  647.  WITH vctype DO
  648.    FOR c := 0C TO 10C DO
  649.      class[c] := CClass{IScntrl};
  650.    END;
  651.    class[11C] := CClass{IScntrl,ISspace,ISblank};
  652.    FOR c := 12C TO 15C DO
  653.      class[c] := CClass{IScntrl,ISspace};
  654.    END;
  655.    FOR c := 16C TO 37C DO
  656.      class[c] := CClass{IScntrl};
  657.    END;
  658.    class[' '] := CClass{ISspace,ISblank,ISprint};
  659.    FOR c := 41C TO 57C DO
  660.      class[c] := CClass{ISpunct,ISgraph,ISprint};
  661.    END;
  662.    FOR c := '0' TO '9' DO
  663.      class[c] := CClass{ISdigit,ISxdigit,ISalnum,ISgraph,ISprint};
  664.    END;
  665.    FOR c := 72C TO 100C DO
  666.      class[c] := CClass{ISpunct,ISgraph,ISprint};
  667.    END;
  668.    FOR c := 'A' TO 'F' DO
  669.      class[c] := CClass{ISxdigit,ISupper,ISalpha,ISalnum,ISgraph,ISprint};
  670.    END;
  671.    FOR c := 'G' TO 'Z' DO
  672.      class[c] := CClass{ISupper,ISalpha,ISalnum,ISgraph,ISprint};
  673.    END;
  674.    FOR c := 133C TO 140C DO
  675.      class[c] := CClass{ISpunct,ISgraph,ISprint};
  676.    END;
  677.    FOR c := 'a' TO 'f' DO
  678.      class[c] := CClass{ISxdigit,ISlower,ISalpha,ISalnum,ISgraph,ISprint};
  679.    END;
  680.    FOR c := 'g' TO 'z' DO
  681.      class[c] := CClass{ISlower,ISalpha,ISalnum,ISgraph,ISprint};
  682.    END;
  683.    FOR c := 173C TO 176C DO
  684.      class[c] := CClass{ISpunct,ISgraph,ISprint};
  685.    END;
  686.    class[177C] := CClass{IScntrl};
  687.    FOR c := 200C TO 377C DO
  688.      class[c] := CClass{};
  689.    END;
  690.  
  691.    FOR c := 0C TO 140C DO
  692.      toupper[c] := c;
  693.    END;
  694.    FOR c := 141C TO 172C DO
  695.      toupper[c] := CHR(ORD(c) - 32);
  696.    END;
  697.    FOR c := 173C TO 377C DO
  698.      toupper[c] := c;
  699.    END;
  700.    FOR c := 0C TO 100C DO
  701.      tolower[c] := c;
  702.    END;
  703.    FOR c := 101C TO 132C DO
  704.      tolower[c] := CHR(ORD(c) + 32);
  705.    END;
  706.    FOR c := 133C TO 377C DO
  707.      tolower[c] := c;
  708.    END;
  709.  END;
  710.  
  711.  bios[0]  := "OK";
  712.  bios[1]  := "Error";
  713.  bios[2]  := "Device not ready";
  714.  bios[3]  := "Unknown command";
  715.  bios[4]  := "Crc error";
  716.  bios[5]  := "Bad request";
  717.  bios[6]  := "Seek error";
  718.  bios[7]  := "Unknown media";
  719.  bios[8]  := "Sector not found";
  720.  bios[9]  := "Out of paper";
  721.  bios[10] := "Write failure";
  722.  bios[11] := "Read failure";
  723.  bios[12] := "General error";
  724.  bios[13] := "Write protected";
  725.  bios[14] := "Media changed";
  726.  bios[15] := "Unknown device";
  727.  bios[16] := "Bad sectors found";
  728.  bios[17] := "Another disk";
  729.  bios[18] := "Insert media!";
  730.  bios[19] := "Device not responding";
  731.  
  732.  gemdos[0]  := "Invalid function number";
  733.  gemdos[1]  := "File not found";
  734.  gemdos[2]  := "Path not found";
  735.  gemdos[3]  := "No more handles";
  736.  gemdos[4]  := "Access denied";
  737.  gemdos[5]  := "Invalid handle";
  738.  gemdos[6]  := "Out of memory";
  739.  gemdos[7]  := "Invalid memory block";
  740.  gemdos[8]  := "Invalid drive";
  741.  gemdos[9]  := "Different drives";
  742.  gemdos[10] := "No more files";
  743.  gemdos[11] := "File locked";
  744.  gemdos[12] := "Invalid lock";
  745.  gemdos[13] := "Range error";
  746.  gemdos[14] := "Internal error";
  747.  gemdos[15] := "Not executable";
  748.  gemdos[16] := "Memory block growth failure";
  749.  
  750.  mint[0] := "Too many symbolic links";
  751.  mint[1] := "Broken pipe";
  752.  
  753.  socket[0]  := "Socket operation on non-socket";
  754.  socket[1]  := "Destination address required";
  755.  socket[2]  := "Message too long";
  756.  socket[3]  := "Protocol wrong type for socket";
  757.  socket[4]  := "Protocol not available";
  758.  socket[5]  := "Protocol not supported";
  759.  socket[6]  := "Socket type not supported";
  760.  socket[7]  := "Operation not supported";
  761.  socket[8]  := "Protocol family not supported";
  762.  socket[9]  := "Address family not supported by protocol";
  763.  socket[10] := "Address already in use";
  764.  socket[11] := "Cannot assign requested address";
  765.  socket[12] := "Network is down";
  766.  socket[13] := "Network is unreachable";
  767.  socket[14] := "Network dropped conn. because of reset";
  768.  socket[15] := "Software caused connection abort";
  769.  socket[16] := "Connection reset by peer";
  770.  socket[17] := "Socket is already connected";
  771.  socket[18] := "Socket is not connected";
  772.  socket[19] := "Cannot send after shutdown";
  773.  socket[20] := "Connection timed out";
  774.  socket[21] := "Connection refused";
  775.  socket[22] := "Host is down";
  776.  socket[23] := "No route to host";
  777.  socket[24] := "Operation already in progress";
  778.  socket[25] := "Operation now in progress";
  779.  socket[26] := "Operation would block";
  780.  
  781.  posix[0]  := "Interrupted by signal";
  782.  posix[1]  := "Resource unavailable";
  783.  posix[2]  := "Deadlock would result";
  784.  posix[3]  := "Invalid argument";
  785.  posix[4]  := "File exists";
  786.  posix[5]  := "File too large";
  787.  posix[6]  := "Argument list too long";
  788.  posix[7]  := "Is a directory";
  789.  posix[8]  := "Too many links";
  790.  posix[9]  := "Filename too long";
  791.  posix[10] := "No locks available";
  792.  posix[11] := "No space left on device";
  793.  posix[12] := "Directory not empty";
  794.  posix[13] := "Wrong i/o control op";
  795.  posix[14] := "Result too large";
  796.  posix[15] := "Invalid seek";
  797.  
  798.  signal[0]  := "No signal";
  799.  signal[1]  := "Hangup";
  800.  signal[2]  := "Interrupt";
  801.  signal[3]  := "Quit";
  802.  signal[4]  := "Illegal instruction";
  803.  signal[5]  := "Trace trap";
  804.  signal[6]  := "Abort";
  805.  signal[7]  := "Privilege violation";
  806.  signal[8]  := "Floating point exception";
  807.  signal[9]  := "Killed";
  808.  signal[10] := "Bus error";
  809.  signal[11] := "Segmentation fault";
  810.  signal[12] := "Bad argument to system call";
  811.  signal[13] := "Broken pipe";
  812.  signal[14] := "Alarm clock";
  813.  signal[15] := "Terminated";
  814.  signal[16] := "Urgent condition on I/O channel";
  815.  signal[17] := "Stopped (signal)";
  816.  signal[18] := "Stopped";
  817.  signal[19] := "Continued";
  818.  signal[20] := "Child process exited";
  819.  signal[21] := "Stopped (tty input)";
  820.  signal[22] := "Stopped (tty output)";
  821.  signal[23] := "I/O possible";
  822.  signal[24] := "CPU limit exceeded";
  823.  signal[25] := "File size limit exceeded";
  824.  signal[26] := "Virtual timer alarm";
  825.  signal[27] := "Profiling signal";
  826.  signal[28] := "Window system signal";
  827.  signal[29] := "User-defined signal 1";
  828.  signal[30] := "User-defined signal 2";
  829. #endif
  830. #endif
  831.  
  832.  Ctype := CADR(vctype);
  833.  
  834.  WITH messages DO
  835.    FOR i := 0 TO 19 DO
  836.      bioserr[i] := ADR(bios[i]);
  837.    END;
  838.    FOR i := 0 TO 5 DO
  839.      gemdoserr[i] := ADR(gemdos[i]);
  840.    END;
  841.    gemdoserr[6] := ADR(uerr);
  842.    gemdoserr[7] := ADR(gemdos[6]);
  843.    gemdoserr[8] := ADR(gemdos[7]);
  844.    FOR i := 9 TO 13 DO
  845.      gemdoserr[i] := ADR(uerr);
  846.    END;
  847.    gemdoserr[14] := ADR(gemdos[8]);
  848.    gemdoserr[15] := ADR(uerr);
  849.    gemdoserr[16] := ADR(gemdos[9]);
  850.    gemdoserr[17] := ADR(gemdos[10]);
  851.    FOR i := 18 TO 25 DO
  852.      gemdoserr[i] := ADR(uerr);
  853.    END;
  854.    gemdoserr[26] := ADR(gemdos[11]);
  855.    gemdoserr[27] := ADR(gemdos[12]);
  856.    FOR i := 28 TO 31 DO
  857.      gemdoserr[i] := ADR(uerr);
  858.    END;
  859.    gemdoserr[32] := ADR(gemdos[13]);
  860.    gemdoserr[33] := ADR(gemdos[14]);
  861.    gemdoserr[34] := ADR(gemdos[15]);
  862.    gemdoserr[35] := ADR(gemdos[16]);
  863.    minterr[0] := ADR(mint[0]);
  864.    minterr[1] := ADR(mint[1]);
  865.    FOR i := 0 TO 26 DO
  866.      socketerr[i] := ADR(socket[i]);
  867.    END;
  868.    FOR i := 0 TO 15 DO
  869.      posixerr[i] := ADR(posix[i]);
  870.    END;
  871.    FOR i := 0 TO 30 DO
  872.      signalstr[i] := ADR(signal[i]);
  873.    END;
  874.    unknownerr := ADR(uerr);
  875.    unknownsig := ADR(usig);
  876.  END;
  877.  
  878.  Messages := ADR(messages);
  879. END LCPOSIX.
  880.