home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / Examples / p2-383 < prev    next >
Encoding:
Text File  |  1994-05-11  |  1.4 KB  |  58 lines

  1. #include <string.h>
  2.  
  3. #include "os.h"
  4. #include "netfs.h"
  5.  
  6. os_error *read_file_server_version (void)
  7.  
  8. {  os_error *error = NULL;
  9.    int rx_count;
  10.    netfs_read_version version;
  11.  
  12.    if ((error = xnetfs_do_fs_op (netfs_FS_OP_READ_VERSION,
  13.          (netfs_op *) &version, 0, sizeof version, NULL, &rx_count))
  14.          != NULL)
  15.       goto finish;
  16.    version AS reply.version [rx_count] = '\0';
  17.  
  18.    if ((error = xos_write0 (version AS reply.version)) != NULL)
  19.       goto finish;
  20.    if ((error = xos_new_line ()) != NULL)
  21.       goto finish;
  22.  
  23. finish:
  24.    return error;
  25. }
  26.  
  27. os_error *print_station_number_of_user (char *user)
  28.  
  29. {  os_error *error = NULL;
  30.    os_station_number station_number;
  31.    netfs_read_user_info user_info;
  32.    char net_station [os_NET_STATION_LIMIT + 1];
  33.  
  34.    strcpy (user_info AS request.user_name, user);
  35.    user_info AS request.user_name
  36.          [strlen (user_info AS request.user_name)] = '\r';
  37.  
  38.    if ((error = xnetfs_do_fs_op (netfs_FS_OP_READ_USER_INFO,
  39.          (netfs_op *) &user_info, 0, sizeof user_info, NULL, NULL))
  40.          != NULL)
  41.       goto finish;
  42.  
  43.    station_number.net     = user_info AS reply.net;
  44.    station_number.station = user_info AS reply.station;
  45.  
  46.    if ((error = xos_convert_net_station (&station_number, net_station,
  47.          os_NET_STATION_LIMIT, NULL)) != NULL)
  48.       goto finish;
  49.  
  50.    if ((error = xos_write0 (net_station)) != NULL)
  51.       goto finish;
  52.    if ((error = xos_new_line ()) != NULL)
  53.       goto finish;
  54.  
  55. finish:
  56.    return error;
  57. }
  58.