home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / TUTORIAL / COMMON / DATABASE.RPC
Encoding:
Text File  |  1989-12-11  |  2.9 KB  |  88 lines

  1. %h{
  2. /*                                                                            *
  3.  *                                                                            *
  4.  *                  Copyright 1987, 1988, 1989 Netwise, Inc.                  *
  5.  *                              All Rights Reserved                           *
  6.  *   This software contains information which is proprietary to and a trade   *
  7.  *   secret of Netwise, Inc. It is not to be used, reproduced, or disclosed   *
  8.  *   except as authorized in your license agreement.                          *
  9.  *                                                                            *
  10.  *                          Restricted Rights Legend                          *
  11.  *   Use, duplication,  or  disclosure  by the  Government  is  subject  to   *
  12.  *   restrictions as set forth in subparagraph (c)(1)(ii) of the Rights  in   *
  13.  *   Technical Data and  Computer Software clause  at 252.227-7013, or  the   *
  14.  *   equivalent Government clause for other agencies.                         *
  15.  *   Contractor: Netwise, Inc., Boulder, CO 80301 USA                         *
  16.  *                                                                            *
  17.  */ 
  18. %}
  19.  
  20. /*
  21.  * File: tutorial\common\database.rpc
  22.  *
  23.  * This example runs in the following environment:
  24.  *    NetWare RPC 1.0, NetWare 2.1 or higher, DOS 3.3
  25.  *
  26.  * This is the RPC Specification file for the tutorial example.
  27.  */
  28.  
  29. /* Set interface variables */
  30. interface {
  31.     set INTERFACE_NAME dbase; /* Name the dispatcher procedure */
  32. };
  33.  
  34. /* Include defined values from standalone program */
  35. %h {
  36. #define TRUE      1
  37. #define FALSE     0
  38. #define SUCCESS   0
  39. #define ERROR    -1
  40. #define PERMANENT '0'
  41. #define TEMPORARY '1'
  42. #define OLDNAME   1
  43. #define OLDNUM    2
  44. #define DBFULL    3
  45. #define MAXREC   50
  46. #define FIRSTNAME 30
  47. #define LASTNAME 30
  48. #define NAMESIZE (FIRSTNAME + LASTNAME)
  49. #define AGCYSIZE 60
  50. %}
  51.  
  52. /* Include definition of structure type from standalone program */
  53. struct employee_record {
  54.     /* the employee_name param uses a termination expression */
  55.     char employee_name[NAMESIZE] (*$0 == '\0');
  56.     char employee_type;
  57.     /* each element of a union has a choice expression,
  58.        and the temp_agency param has a termination expression */
  59.     union {
  60.         ($$->employee_type == PERMANENT) int employee_id;
  61.         ($$->employee_type == TEMPORARY)
  62.             char temp_agency[AGCYSIZE] (*$0 == '\0');
  63.     } employee_info;
  64. };
  65.  
  66. /* process binding variable */ 
  67. extern server_name [bind in] sname;
  68.  
  69. int
  70. get_record(
  71.     /* the name param uses a termination expression */
  72.     char [in] name[NAMESIZE] (*$0 == '\0'),
  73.     struct employee_record [out] **record_ptr
  74. );
  75.  
  76. int
  77. append_record(struct employee_record [in] *record_ptr)
  78. {
  79.     /* external output variable */
  80.     extern int [out] recerr;
  81. }
  82.  
  83. int
  84. shut_down_server();
  85. /* Routine added to allow client program to
  86.  * terminate server program when user exits
  87.  */
  88.