| 1 | 
  | 
 | 
| 2 | 
< | 
#include <cstring> | 
| 3 | 
< | 
#include <cstdio> | 
| 4 | 
< | 
#include <cstdlib> | 
| 2 | 
> | 
#include <string.h> | 
| 3 | 
> | 
#include <stdio.h> | 
| 4 | 
> | 
#include <stdlib.h> | 
| 5 | 
  | 
 | 
| 6 | 
  | 
#include "Globals.hpp" | 
| 7 | 
  | 
#include "BASS_interface.h" | 
| 15 | 
  | 
// Globals ************************************************ | 
| 16 | 
  | 
 | 
| 17 | 
  | 
typedef enum { GLOBAL_BLK, MOLECULE_BLK, ATOM_BLK, BOND_BLK, BEND_BLK, | 
| 18 | 
< | 
               TORSION_BLK, COMPONENT_BLK } block_type; | 
| 18 | 
> | 
               TORSION_BLK, COMPONENT_BLK, ZCONSTRAINT_BLK } block_type; | 
| 19 | 
  | 
 | 
| 20 | 
  | 
block_type current_block = GLOBAL_BLK; | 
| 21 | 
  | 
#define MAX_NEST 20 // the max number of nested blocks | 
| 50 | 
  | 
      incr_block( MOLECULE_BLK ); | 
| 51 | 
  | 
      handled = the_stamps->newMolecule( the_event ); | 
| 52 | 
  | 
      break; | 
| 53 | 
+ | 
 | 
| 54 | 
+ | 
    case ZCONSTRAINT: | 
| 55 | 
+ | 
      incr_block( ZCONSTRAINT_BLK ); | 
| 56 | 
+ | 
      handled = the_globals->newZconstraint( the_event ); | 
| 57 | 
+ | 
      break; | 
| 58 | 
  | 
       | 
| 59 | 
  | 
    case COMPONENT: | 
| 60 | 
  | 
      incr_block( COMPONENT_BLK ); | 
| 227 | 
  | 
      return 0; | 
| 228 | 
  | 
    } | 
| 229 | 
  | 
    break; | 
| 230 | 
+ | 
 | 
| 231 | 
+ | 
  case ZCONSTRAINT_BLK: | 
| 232 | 
+ | 
  | 
| 233 | 
+ | 
    switch( the_event->event_type ){ | 
| 234 | 
+ | 
       | 
| 235 | 
+ | 
    case ASSIGNMENT: | 
| 236 | 
+ | 
      handled = the_globals->zConstraintAssign( the_event ); | 
| 237 | 
+ | 
      break; | 
| 238 | 
+ | 
       | 
| 239 | 
+ | 
    case BLOCK_END: | 
| 240 | 
+ | 
      decr_block(); | 
| 241 | 
+ | 
      handled = the_globals->zConstraintEnd( the_event ); | 
| 242 | 
+ | 
      break; | 
| 243 | 
+ | 
 | 
| 244 | 
+ | 
    default: | 
| 245 | 
+ | 
      the_event->err_msg =  | 
| 246 | 
+ | 
        strdup( "not a valid zConstraint event\n" ); | 
| 247 | 
+ | 
      return 0; | 
| 248 | 
+ | 
    } | 
| 249 | 
+ | 
    break; | 
| 250 | 
  | 
     | 
| 251 | 
  | 
  case COMPONENT_BLK: | 
| 252 | 
  | 
     | 
| 256 | 
  | 
      handled = the_globals->componentAssign( the_event ); | 
| 257 | 
  | 
      break; | 
| 258 | 
  | 
       | 
| 234 | 
– | 
    case START_INDEX: | 
| 235 | 
– | 
      handled = the_globals->componentStartIndex( the_event ); | 
| 236 | 
– | 
      break; | 
| 237 | 
– | 
       | 
| 259 | 
  | 
    case BLOCK_END: | 
| 260 | 
  | 
      decr_block(); | 
| 261 | 
  | 
      handled = the_globals->componentEnd(the_event ); |