/*
 * fetadd.x - Fetch and add routine
 */

const MAXSTRINGSIZE = 8 ;
typedef string Identifier<MAXSTRINGSIZE> ;

enum initializeResult {
  INIT_OK = 1,
  INIT_ALREADYDEFINED = 2,
  INIT_IMPROPERSTRING = 3
} ;

struct incrementArg {
  Identifier incrVariable ;
  int incrValue ;
} ;

enum incrementRC {
  INCR_OK = 1 ,
  INCR_NOTDEFINED = 2 ,
  INCR_IMPROPERSTRING = 3
} ;

union incrementResult switch(incrementRC incrSelector) {
case INCR_OK:
  int incrValue ;
default:
  void;
} ;

program CSCI333FETADD_PROG {
    version FETADD_VERS {
	initializeResult create(Identifier) = 1 ;
	incrementResult  increment(incrementArg) = 2 ;
    } = 1;				/* version number = 1 */
} = 0x30020295 ;	/* My userid is 295 */
