home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / Examples / p1-108 < prev    next >
Encoding:
Text File  |  1994-05-12  |  1023 b   |  45 lines

  1. #include <stdio.h>
  2.  
  3. #include "os.h"
  4. #include "territory.h"
  5.  
  6. extern void Vector_Veneer (void);
  7.  
  8. void ex (void)
  9.  
  10. {  char *lowercase_table, *uppercase_table, flag = 1, command [80];
  11.    os_error *error = NULL;
  12.    bool done_claim = FALSE;
  13.  
  14.    if ((error = xterritory_lower_case_table (territory_CURRENT,
  15.          &lowercase_table)) != NULL)
  16.       goto finish;
  17.    if ((error = xterritory_upper_case_table (territory_CURRENT,
  18.          &uppercase_table)) != NULL)
  19.       goto finish;
  20.  
  21.    if ((error = xos_claim (WrchV, (void *) &Vector_Veneer,
  22.          (byte *) &flag)) != NULL)
  23.       goto finish;
  24.    done_claim = TRUE;
  25.    
  26.    do
  27.    {  fgets (command, sizeof command - 1, stdin);
  28.       if ((error = xos_cli (command)) != NULL)
  29.          goto finish;
  30.    }
  31.    while (command [0] != '\n');
  32.  
  33. finish:
  34.    if (done_claim)
  35.    {  os_error *error1;
  36.  
  37.       error1 = xos_release (WrchV, (void *) &Vector_Veneer,
  38.             (byte *) &flag);
  39.       if (error == NULL) error = error1;
  40.    }
  41.  
  42.    if (error != NULL)
  43.       os_generate_error (error);
  44. }
  45.