ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
messageboards.c
Go to the documentation of this file.
1 
6 #include "header.h"
7 
8 
9 
10 /* Box filtering functions */
11 
12 
13 
14 
16 {
18  void *ptr_anon;
19 };
20 
26 void add_firm_bank_init_loans_message(int bank_id, double amount)
27 {
28  int rc;
30 
31  msg.bank_id = bank_id;
32  msg.amount = amount;
33 
34 
35  rc = MB_AddMessage(b_firm_bank_init_loans, &msg);
36  #ifdef ERRCHECK
37  if (rc != MB_SUCCESS)
38  {
39  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_init_loans' board\n");
40  switch(rc) {
41  case MB_ERR_INVALID:
42  fprintf(stderr, "\t reason: 'firm_bank_init_loans' board has not been created?\n");
43  break;
44  case MB_ERR_MEMALLOC:
45  fprintf(stderr, "\t reason: out of memory\n");
46  break;
47  case MB_ERR_LOCKED:
48  fprintf(stderr, "\t reason: 'firm_bank_init_loans' board is locked\n");
49  break;
50  case MB_ERR_INTERNAL:
51  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
52  break;
53  default:
54  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
55  break;
56  }
57 
58 
59  exit(rc);
60  }
61  #endif
62 }
63 
64 inline static m_firm_bank_init_loans* getInternalMessage_firm_bank_init_loans(void)
65 {
66  static m_firm_bank_init_loans *msg_prev = NULL;
67  union pu_firm_bank_init_loans msg_pu;
68  int rc;
69 
70  /* deallocate previously returned message */
71  if (msg_prev != NULL)
72  {
73  free(msg_prev);
74  }
75  else
76  {
77  rc = MB_Iterator_Rewind(i_firm_bank_init_loans);
78  #ifdef ERRCHECK
79  if (rc != MB_SUCCESS)
80  {
81  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_init_loans' Iterator\n");
82  switch(rc) {
83  case MB_ERR_INVALID:
84  fprintf(stderr, "\t reason: 'firm_bank_init_loans' Iterator has not been created?\n");
85  break;
86  default:
87  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
88  break;
89  }
90 
91 
92  exit(rc);
93  }
94  #endif
95  }
96 
97  /* get next message from iterator */
98  rc = MB_Iterator_GetMessage(i_firm_bank_init_loans, &(msg_pu.ptr_anon));
99  #ifdef ERRCHECK
100  if (rc != MB_SUCCESS)
101  {
102  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_init_loans' Iterator\n");
103  switch(rc) {
104  case MB_ERR_INVALID:
105  fprintf(stderr, "\t reason: 'firm_bank_init_loans' Iterator has not been created?\n");
106  break;
107  case MB_ERR_MEMALLOC:
108  fprintf(stderr, "\t reason: out of memory\n");
109  break;
110  default:
111  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
112  break;
113  }
114 
115 
116  exit(rc);
117  }
118  #endif
119 
120  /* store pointer so memory can be deallocated later */
121  msg_prev = msg_pu.ptr;
122 
123  return msg_pu.ptr;
124 }
125 
131 {
132  return getInternalMessage_firm_bank_init_loans();
133 }
134 
141 {
142  return getInternalMessage_firm_bank_init_loans();
143 }
144 
145 
146 /* Box filtering functions */
147 
148 
149 
150 
152 {
154  void *ptr_anon;
155 };
156 
162 void add_firm_bank_init_deposit_message(int bank_id, double amount)
163 {
164  int rc;
166 
167  msg.bank_id = bank_id;
168  msg.amount = amount;
169 
170 
171  rc = MB_AddMessage(b_firm_bank_init_deposit, &msg);
172  #ifdef ERRCHECK
173  if (rc != MB_SUCCESS)
174  {
175  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_init_deposit' board\n");
176  switch(rc) {
177  case MB_ERR_INVALID:
178  fprintf(stderr, "\t reason: 'firm_bank_init_deposit' board has not been created?\n");
179  break;
180  case MB_ERR_MEMALLOC:
181  fprintf(stderr, "\t reason: out of memory\n");
182  break;
183  case MB_ERR_LOCKED:
184  fprintf(stderr, "\t reason: 'firm_bank_init_deposit' board is locked\n");
185  break;
186  case MB_ERR_INTERNAL:
187  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
188  break;
189  default:
190  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
191  break;
192  }
193 
194 
195  exit(rc);
196  }
197  #endif
198 }
199 
200 inline static m_firm_bank_init_deposit* getInternalMessage_firm_bank_init_deposit(void)
201 {
202  static m_firm_bank_init_deposit *msg_prev = NULL;
203  union pu_firm_bank_init_deposit msg_pu;
204  int rc;
205 
206  /* deallocate previously returned message */
207  if (msg_prev != NULL)
208  {
209  free(msg_prev);
210  }
211  else
212  {
213  rc = MB_Iterator_Rewind(i_firm_bank_init_deposit);
214  #ifdef ERRCHECK
215  if (rc != MB_SUCCESS)
216  {
217  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_init_deposit' Iterator\n");
218  switch(rc) {
219  case MB_ERR_INVALID:
220  fprintf(stderr, "\t reason: 'firm_bank_init_deposit' Iterator has not been created?\n");
221  break;
222  default:
223  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
224  break;
225  }
226 
227 
228  exit(rc);
229  }
230  #endif
231  }
232 
233  /* get next message from iterator */
234  rc = MB_Iterator_GetMessage(i_firm_bank_init_deposit, &(msg_pu.ptr_anon));
235  #ifdef ERRCHECK
236  if (rc != MB_SUCCESS)
237  {
238  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_init_deposit' Iterator\n");
239  switch(rc) {
240  case MB_ERR_INVALID:
241  fprintf(stderr, "\t reason: 'firm_bank_init_deposit' Iterator has not been created?\n");
242  break;
243  case MB_ERR_MEMALLOC:
244  fprintf(stderr, "\t reason: out of memory\n");
245  break;
246  default:
247  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
248  break;
249  }
250 
251 
252  exit(rc);
253  }
254  #endif
255 
256  /* store pointer so memory can be deallocated later */
257  msg_prev = msg_pu.ptr;
258 
259  return msg_pu.ptr;
260 }
261 
267 {
268  return getInternalMessage_firm_bank_init_deposit();
269 }
270 
277 {
278  return getInternalMessage_firm_bank_init_deposit();
279 }
280 
281 
282 /* Box filtering functions */
283 
284 
285 
286 
288 {
290  void *ptr_anon;
291 };
292 
298 void add_firm_bank_update_deposit_message(int bank_id, double amount)
299 {
300  int rc;
302 
303  msg.bank_id = bank_id;
304  msg.amount = amount;
305 
306 
307  rc = MB_AddMessage(b_firm_bank_update_deposit, &msg);
308  #ifdef ERRCHECK
309  if (rc != MB_SUCCESS)
310  {
311  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_update_deposit' board\n");
312  switch(rc) {
313  case MB_ERR_INVALID:
314  fprintf(stderr, "\t reason: 'firm_bank_update_deposit' board has not been created?\n");
315  break;
316  case MB_ERR_MEMALLOC:
317  fprintf(stderr, "\t reason: out of memory\n");
318  break;
319  case MB_ERR_LOCKED:
320  fprintf(stderr, "\t reason: 'firm_bank_update_deposit' board is locked\n");
321  break;
322  case MB_ERR_INTERNAL:
323  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
324  break;
325  default:
326  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
327  break;
328  }
329 
330 
331  exit(rc);
332  }
333  #endif
334 }
335 
336 inline static m_firm_bank_update_deposit* getInternalMessage_firm_bank_update_deposit(void)
337 {
338  static m_firm_bank_update_deposit *msg_prev = NULL;
339  union pu_firm_bank_update_deposit msg_pu;
340  int rc;
341 
342  /* deallocate previously returned message */
343  if (msg_prev != NULL)
344  {
345  free(msg_prev);
346  }
347  else
348  {
349  rc = MB_Iterator_Rewind(i_firm_bank_update_deposit);
350  #ifdef ERRCHECK
351  if (rc != MB_SUCCESS)
352  {
353  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_update_deposit' Iterator\n");
354  switch(rc) {
355  case MB_ERR_INVALID:
356  fprintf(stderr, "\t reason: 'firm_bank_update_deposit' Iterator has not been created?\n");
357  break;
358  default:
359  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
360  break;
361  }
362 
363 
364  exit(rc);
365  }
366  #endif
367  }
368 
369  /* get next message from iterator */
370  rc = MB_Iterator_GetMessage(i_firm_bank_update_deposit, &(msg_pu.ptr_anon));
371  #ifdef ERRCHECK
372  if (rc != MB_SUCCESS)
373  {
374  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_update_deposit' Iterator\n");
375  switch(rc) {
376  case MB_ERR_INVALID:
377  fprintf(stderr, "\t reason: 'firm_bank_update_deposit' Iterator has not been created?\n");
378  break;
379  case MB_ERR_MEMALLOC:
380  fprintf(stderr, "\t reason: out of memory\n");
381  break;
382  default:
383  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
384  break;
385  }
386 
387 
388  exit(rc);
389  }
390  #endif
391 
392  /* store pointer so memory can be deallocated later */
393  msg_prev = msg_pu.ptr;
394 
395  return msg_pu.ptr;
396 }
397 
403 {
404  return getInternalMessage_firm_bank_update_deposit();
405 }
406 
413 {
414  return getInternalMessage_firm_bank_update_deposit();
415 }
416 
417 
418 /* Box filtering functions */
419 
420 
421 
422 
424 {
426  void *ptr_anon;
427 };
428 
434 void add_household_bank_init_mortgages_message(int bank_id, double amount)
435 {
436  int rc;
438 
439  msg.bank_id = bank_id;
440  msg.amount = amount;
441 
442 
443  rc = MB_AddMessage(b_household_bank_init_mortgages, &msg);
444  #ifdef ERRCHECK
445  if (rc != MB_SUCCESS)
446  {
447  fprintf(stderr, "ERROR: Could not add message to 'household_bank_init_mortgages' board\n");
448  switch(rc) {
449  case MB_ERR_INVALID:
450  fprintf(stderr, "\t reason: 'household_bank_init_mortgages' board has not been created?\n");
451  break;
452  case MB_ERR_MEMALLOC:
453  fprintf(stderr, "\t reason: out of memory\n");
454  break;
455  case MB_ERR_LOCKED:
456  fprintf(stderr, "\t reason: 'household_bank_init_mortgages' board is locked\n");
457  break;
458  case MB_ERR_INTERNAL:
459  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
460  break;
461  default:
462  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
463  break;
464  }
465 
466 
467  exit(rc);
468  }
469  #endif
470 }
471 
472 inline static m_household_bank_init_mortgages* getInternalMessage_household_bank_init_mortgages(void)
473 {
474  static m_household_bank_init_mortgages *msg_prev = NULL;
476  int rc;
477 
478  /* deallocate previously returned message */
479  if (msg_prev != NULL)
480  {
481  free(msg_prev);
482  }
483  else
484  {
485  rc = MB_Iterator_Rewind(i_household_bank_init_mortgages);
486  #ifdef ERRCHECK
487  if (rc != MB_SUCCESS)
488  {
489  fprintf(stderr, "ERROR: Could not rewind 'household_bank_init_mortgages' Iterator\n");
490  switch(rc) {
491  case MB_ERR_INVALID:
492  fprintf(stderr, "\t reason: 'household_bank_init_mortgages' Iterator has not been created?\n");
493  break;
494  default:
495  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
496  break;
497  }
498 
499 
500  exit(rc);
501  }
502  #endif
503  }
504 
505  /* get next message from iterator */
506  rc = MB_Iterator_GetMessage(i_household_bank_init_mortgages, &(msg_pu.ptr_anon));
507  #ifdef ERRCHECK
508  if (rc != MB_SUCCESS)
509  {
510  fprintf(stderr, "ERROR: Could not get message from 'household_bank_init_mortgages' Iterator\n");
511  switch(rc) {
512  case MB_ERR_INVALID:
513  fprintf(stderr, "\t reason: 'household_bank_init_mortgages' Iterator has not been created?\n");
514  break;
515  case MB_ERR_MEMALLOC:
516  fprintf(stderr, "\t reason: out of memory\n");
517  break;
518  default:
519  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
520  break;
521  }
522 
523 
524  exit(rc);
525  }
526  #endif
527 
528  /* store pointer so memory can be deallocated later */
529  msg_prev = msg_pu.ptr;
530 
531  return msg_pu.ptr;
532 }
533 
539 {
540  return getInternalMessage_household_bank_init_mortgages();
541 }
542 
549 {
550  return getInternalMessage_household_bank_init_mortgages();
551 }
552 
553 
554 /* Box filtering functions */
555 
556 
557 
558 
560 {
562  void *ptr_anon;
563 };
564 
570 void add_household_bank_init_deposit_message(int bank_id, double amount)
571 {
572  int rc;
574 
575  msg.bank_id = bank_id;
576  msg.amount = amount;
577 
578 
579  rc = MB_AddMessage(b_household_bank_init_deposit, &msg);
580  #ifdef ERRCHECK
581  if (rc != MB_SUCCESS)
582  {
583  fprintf(stderr, "ERROR: Could not add message to 'household_bank_init_deposit' board\n");
584  switch(rc) {
585  case MB_ERR_INVALID:
586  fprintf(stderr, "\t reason: 'household_bank_init_deposit' board has not been created?\n");
587  break;
588  case MB_ERR_MEMALLOC:
589  fprintf(stderr, "\t reason: out of memory\n");
590  break;
591  case MB_ERR_LOCKED:
592  fprintf(stderr, "\t reason: 'household_bank_init_deposit' board is locked\n");
593  break;
594  case MB_ERR_INTERNAL:
595  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
596  break;
597  default:
598  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
599  break;
600  }
601 
602 
603  exit(rc);
604  }
605  #endif
606 }
607 
608 inline static m_household_bank_init_deposit* getInternalMessage_household_bank_init_deposit(void)
609 {
610  static m_household_bank_init_deposit *msg_prev = NULL;
611  union pu_household_bank_init_deposit msg_pu;
612  int rc;
613 
614  /* deallocate previously returned message */
615  if (msg_prev != NULL)
616  {
617  free(msg_prev);
618  }
619  else
620  {
621  rc = MB_Iterator_Rewind(i_household_bank_init_deposit);
622  #ifdef ERRCHECK
623  if (rc != MB_SUCCESS)
624  {
625  fprintf(stderr, "ERROR: Could not rewind 'household_bank_init_deposit' Iterator\n");
626  switch(rc) {
627  case MB_ERR_INVALID:
628  fprintf(stderr, "\t reason: 'household_bank_init_deposit' Iterator has not been created?\n");
629  break;
630  default:
631  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
632  break;
633  }
634 
635 
636  exit(rc);
637  }
638  #endif
639  }
640 
641  /* get next message from iterator */
642  rc = MB_Iterator_GetMessage(i_household_bank_init_deposit, &(msg_pu.ptr_anon));
643  #ifdef ERRCHECK
644  if (rc != MB_SUCCESS)
645  {
646  fprintf(stderr, "ERROR: Could not get message from 'household_bank_init_deposit' Iterator\n");
647  switch(rc) {
648  case MB_ERR_INVALID:
649  fprintf(stderr, "\t reason: 'household_bank_init_deposit' Iterator has not been created?\n");
650  break;
651  case MB_ERR_MEMALLOC:
652  fprintf(stderr, "\t reason: out of memory\n");
653  break;
654  default:
655  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
656  break;
657  }
658 
659 
660  exit(rc);
661  }
662  #endif
663 
664  /* store pointer so memory can be deallocated later */
665  msg_prev = msg_pu.ptr;
666 
667  return msg_pu.ptr;
668 }
669 
675 {
676  return getInternalMessage_household_bank_init_deposit();
677 }
678 
685 {
686  return getInternalMessage_household_bank_init_deposit();
687 }
688 
689 
690 /* Box filtering functions */
691 
692 
693 
694 
696 {
698  void *ptr_anon;
699 };
700 
706 void add_household_bank_update_deposit_message(int bank_id, double amount)
707 {
708  int rc;
710 
711  msg.bank_id = bank_id;
712  msg.amount = amount;
713 
714 
715  rc = MB_AddMessage(b_household_bank_update_deposit, &msg);
716  #ifdef ERRCHECK
717  if (rc != MB_SUCCESS)
718  {
719  fprintf(stderr, "ERROR: Could not add message to 'household_bank_update_deposit' board\n");
720  switch(rc) {
721  case MB_ERR_INVALID:
722  fprintf(stderr, "\t reason: 'household_bank_update_deposit' board has not been created?\n");
723  break;
724  case MB_ERR_MEMALLOC:
725  fprintf(stderr, "\t reason: out of memory\n");
726  break;
727  case MB_ERR_LOCKED:
728  fprintf(stderr, "\t reason: 'household_bank_update_deposit' board is locked\n");
729  break;
730  case MB_ERR_INTERNAL:
731  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
732  break;
733  default:
734  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
735  break;
736  }
737 
738 
739  exit(rc);
740  }
741  #endif
742 }
743 
744 inline static m_household_bank_update_deposit* getInternalMessage_household_bank_update_deposit(void)
745 {
746  static m_household_bank_update_deposit *msg_prev = NULL;
748  int rc;
749 
750  /* deallocate previously returned message */
751  if (msg_prev != NULL)
752  {
753  free(msg_prev);
754  }
755  else
756  {
757  rc = MB_Iterator_Rewind(i_household_bank_update_deposit);
758  #ifdef ERRCHECK
759  if (rc != MB_SUCCESS)
760  {
761  fprintf(stderr, "ERROR: Could not rewind 'household_bank_update_deposit' Iterator\n");
762  switch(rc) {
763  case MB_ERR_INVALID:
764  fprintf(stderr, "\t reason: 'household_bank_update_deposit' Iterator has not been created?\n");
765  break;
766  default:
767  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
768  break;
769  }
770 
771 
772  exit(rc);
773  }
774  #endif
775  }
776 
777  /* get next message from iterator */
778  rc = MB_Iterator_GetMessage(i_household_bank_update_deposit, &(msg_pu.ptr_anon));
779  #ifdef ERRCHECK
780  if (rc != MB_SUCCESS)
781  {
782  fprintf(stderr, "ERROR: Could not get message from 'household_bank_update_deposit' Iterator\n");
783  switch(rc) {
784  case MB_ERR_INVALID:
785  fprintf(stderr, "\t reason: 'household_bank_update_deposit' Iterator has not been created?\n");
786  break;
787  case MB_ERR_MEMALLOC:
788  fprintf(stderr, "\t reason: out of memory\n");
789  break;
790  default:
791  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
792  break;
793  }
794 
795 
796  exit(rc);
797  }
798  #endif
799 
800  /* store pointer so memory can be deallocated later */
801  msg_prev = msg_pu.ptr;
802 
803  return msg_pu.ptr;
804 }
805 
811 {
812  return getInternalMessage_household_bank_update_deposit();
813 }
814 
821 {
822  return getInternalMessage_household_bank_update_deposit();
823 }
824 
825 
826 /* Box filtering functions */
827 
828 
829 
830 
832 {
834  void *ptr_anon;
835 };
836 
842 void add_bank_centralbank_init_debt_message(int bank_id, double amount)
843 {
844  int rc;
846 
847  msg.bank_id = bank_id;
848  msg.amount = amount;
849 
850 
851  rc = MB_AddMessage(b_bank_centralbank_init_debt, &msg);
852  #ifdef ERRCHECK
853  if (rc != MB_SUCCESS)
854  {
855  fprintf(stderr, "ERROR: Could not add message to 'bank_centralbank_init_debt' board\n");
856  switch(rc) {
857  case MB_ERR_INVALID:
858  fprintf(stderr, "\t reason: 'bank_centralbank_init_debt' board has not been created?\n");
859  break;
860  case MB_ERR_MEMALLOC:
861  fprintf(stderr, "\t reason: out of memory\n");
862  break;
863  case MB_ERR_LOCKED:
864  fprintf(stderr, "\t reason: 'bank_centralbank_init_debt' board is locked\n");
865  break;
866  case MB_ERR_INTERNAL:
867  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
868  break;
869  default:
870  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
871  break;
872  }
873 
874 
875  exit(rc);
876  }
877  #endif
878 }
879 
880 inline static m_bank_centralbank_init_debt* getInternalMessage_bank_centralbank_init_debt(void)
881 {
882  static m_bank_centralbank_init_debt *msg_prev = NULL;
883  union pu_bank_centralbank_init_debt msg_pu;
884  int rc;
885 
886  /* deallocate previously returned message */
887  if (msg_prev != NULL)
888  {
889  free(msg_prev);
890  }
891  else
892  {
893  rc = MB_Iterator_Rewind(i_bank_centralbank_init_debt);
894  #ifdef ERRCHECK
895  if (rc != MB_SUCCESS)
896  {
897  fprintf(stderr, "ERROR: Could not rewind 'bank_centralbank_init_debt' Iterator\n");
898  switch(rc) {
899  case MB_ERR_INVALID:
900  fprintf(stderr, "\t reason: 'bank_centralbank_init_debt' Iterator has not been created?\n");
901  break;
902  default:
903  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
904  break;
905  }
906 
907 
908  exit(rc);
909  }
910  #endif
911  }
912 
913  /* get next message from iterator */
914  rc = MB_Iterator_GetMessage(i_bank_centralbank_init_debt, &(msg_pu.ptr_anon));
915  #ifdef ERRCHECK
916  if (rc != MB_SUCCESS)
917  {
918  fprintf(stderr, "ERROR: Could not get message from 'bank_centralbank_init_debt' Iterator\n");
919  switch(rc) {
920  case MB_ERR_INVALID:
921  fprintf(stderr, "\t reason: 'bank_centralbank_init_debt' Iterator has not been created?\n");
922  break;
923  case MB_ERR_MEMALLOC:
924  fprintf(stderr, "\t reason: out of memory\n");
925  break;
926  default:
927  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
928  break;
929  }
930 
931 
932  exit(rc);
933  }
934  #endif
935 
936  /* store pointer so memory can be deallocated later */
937  msg_prev = msg_pu.ptr;
938 
939  return msg_pu.ptr;
940 }
941 
947 {
948  return getInternalMessage_bank_centralbank_init_debt();
949 }
950 
957 {
958  return getInternalMessage_bank_centralbank_init_debt();
959 }
960 
961 
962 /* Box filtering functions */
963 
964 
965 
966 
968 {
970  void *ptr_anon;
971 };
972 
978 void add_bank_centralbank_init_deposit_message(int bank_id, double amount)
979 {
980  int rc;
982 
983  msg.bank_id = bank_id;
984  msg.amount = amount;
985 
986 
987  rc = MB_AddMessage(b_bank_centralbank_init_deposit, &msg);
988  #ifdef ERRCHECK
989  if (rc != MB_SUCCESS)
990  {
991  fprintf(stderr, "ERROR: Could not add message to 'bank_centralbank_init_deposit' board\n");
992  switch(rc) {
993  case MB_ERR_INVALID:
994  fprintf(stderr, "\t reason: 'bank_centralbank_init_deposit' board has not been created?\n");
995  break;
996  case MB_ERR_MEMALLOC:
997  fprintf(stderr, "\t reason: out of memory\n");
998  break;
999  case MB_ERR_LOCKED:
1000  fprintf(stderr, "\t reason: 'bank_centralbank_init_deposit' board is locked\n");
1001  break;
1002  case MB_ERR_INTERNAL:
1003  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1004  break;
1005  default:
1006  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1007  break;
1008  }
1009 
1010 
1011  exit(rc);
1012  }
1013  #endif
1014 }
1015 
1016 inline static m_bank_centralbank_init_deposit* getInternalMessage_bank_centralbank_init_deposit(void)
1017 {
1018  static m_bank_centralbank_init_deposit *msg_prev = NULL;
1019  union pu_bank_centralbank_init_deposit msg_pu;
1020  int rc;
1021 
1022  /* deallocate previously returned message */
1023  if (msg_prev != NULL)
1024  {
1025  free(msg_prev);
1026  }
1027  else
1028  {
1029  rc = MB_Iterator_Rewind(i_bank_centralbank_init_deposit);
1030  #ifdef ERRCHECK
1031  if (rc != MB_SUCCESS)
1032  {
1033  fprintf(stderr, "ERROR: Could not rewind 'bank_centralbank_init_deposit' Iterator\n");
1034  switch(rc) {
1035  case MB_ERR_INVALID:
1036  fprintf(stderr, "\t reason: 'bank_centralbank_init_deposit' Iterator has not been created?\n");
1037  break;
1038  default:
1039  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1040  break;
1041  }
1042 
1043 
1044  exit(rc);
1045  }
1046  #endif
1047  }
1048 
1049  /* get next message from iterator */
1050  rc = MB_Iterator_GetMessage(i_bank_centralbank_init_deposit, &(msg_pu.ptr_anon));
1051  #ifdef ERRCHECK
1052  if (rc != MB_SUCCESS)
1053  {
1054  fprintf(stderr, "ERROR: Could not get message from 'bank_centralbank_init_deposit' Iterator\n");
1055  switch(rc) {
1056  case MB_ERR_INVALID:
1057  fprintf(stderr, "\t reason: 'bank_centralbank_init_deposit' Iterator has not been created?\n");
1058  break;
1059  case MB_ERR_MEMALLOC:
1060  fprintf(stderr, "\t reason: out of memory\n");
1061  break;
1062  default:
1063  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1064  break;
1065  }
1066 
1067 
1068  exit(rc);
1069  }
1070  #endif
1071 
1072  /* store pointer so memory can be deallocated later */
1073  msg_prev = msg_pu.ptr;
1074 
1075  return msg_pu.ptr;
1076 }
1077 
1083 {
1084  return getInternalMessage_bank_centralbank_init_deposit();
1085 }
1086 
1093 {
1094  return getInternalMessage_bank_centralbank_init_deposit();
1095 }
1096 
1097 
1098 /* Box filtering functions */
1099 
1100 
1101 
1102 
1104 {
1106  void *ptr_anon;
1107 };
1108 
1114 void add_bank_centralbank_update_deposit_message(int bank_id, double amount)
1115 {
1116  int rc;
1118 
1119  msg.bank_id = bank_id;
1120  msg.amount = amount;
1121 
1122 
1123  rc = MB_AddMessage(b_bank_centralbank_update_deposit, &msg);
1124  #ifdef ERRCHECK
1125  if (rc != MB_SUCCESS)
1126  {
1127  fprintf(stderr, "ERROR: Could not add message to 'bank_centralbank_update_deposit' board\n");
1128  switch(rc) {
1129  case MB_ERR_INVALID:
1130  fprintf(stderr, "\t reason: 'bank_centralbank_update_deposit' board has not been created?\n");
1131  break;
1132  case MB_ERR_MEMALLOC:
1133  fprintf(stderr, "\t reason: out of memory\n");
1134  break;
1135  case MB_ERR_LOCKED:
1136  fprintf(stderr, "\t reason: 'bank_centralbank_update_deposit' board is locked\n");
1137  break;
1138  case MB_ERR_INTERNAL:
1139  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1140  break;
1141  default:
1142  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1143  break;
1144  }
1145 
1146 
1147  exit(rc);
1148  }
1149  #endif
1150 }
1151 
1152 inline static m_bank_centralbank_update_deposit* getInternalMessage_bank_centralbank_update_deposit(void)
1153 {
1154  static m_bank_centralbank_update_deposit *msg_prev = NULL;
1156  int rc;
1157 
1158  /* deallocate previously returned message */
1159  if (msg_prev != NULL)
1160  {
1161  free(msg_prev);
1162  }
1163  else
1164  {
1165  rc = MB_Iterator_Rewind(i_bank_centralbank_update_deposit);
1166  #ifdef ERRCHECK
1167  if (rc != MB_SUCCESS)
1168  {
1169  fprintf(stderr, "ERROR: Could not rewind 'bank_centralbank_update_deposit' Iterator\n");
1170  switch(rc) {
1171  case MB_ERR_INVALID:
1172  fprintf(stderr, "\t reason: 'bank_centralbank_update_deposit' Iterator has not been created?\n");
1173  break;
1174  default:
1175  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1176  break;
1177  }
1178 
1179 
1180  exit(rc);
1181  }
1182  #endif
1183  }
1184 
1185  /* get next message from iterator */
1186  rc = MB_Iterator_GetMessage(i_bank_centralbank_update_deposit, &(msg_pu.ptr_anon));
1187  #ifdef ERRCHECK
1188  if (rc != MB_SUCCESS)
1189  {
1190  fprintf(stderr, "ERROR: Could not get message from 'bank_centralbank_update_deposit' Iterator\n");
1191  switch(rc) {
1192  case MB_ERR_INVALID:
1193  fprintf(stderr, "\t reason: 'bank_centralbank_update_deposit' Iterator has not been created?\n");
1194  break;
1195  case MB_ERR_MEMALLOC:
1196  fprintf(stderr, "\t reason: out of memory\n");
1197  break;
1198  default:
1199  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1200  break;
1201  }
1202 
1203 
1204  exit(rc);
1205  }
1206  #endif
1207 
1208  /* store pointer so memory can be deallocated later */
1209  msg_prev = msg_pu.ptr;
1210 
1211  return msg_pu.ptr;
1212 }
1213 
1219 {
1220  return getInternalMessage_bank_centralbank_update_deposit();
1221 }
1222 
1229 {
1230  return getInternalMessage_bank_centralbank_update_deposit();
1231 }
1232 
1233 
1234 /* Box filtering functions */
1235 
1236 
1237 
1238 
1240 {
1242  void *ptr_anon;
1243 };
1244 
1250 {
1251  int rc;
1253 
1254  msg.amount = amount;
1255 
1256 
1257  rc = MB_AddMessage(b_fund_centralbank_init_deposit, &msg);
1258  #ifdef ERRCHECK
1259  if (rc != MB_SUCCESS)
1260  {
1261  fprintf(stderr, "ERROR: Could not add message to 'fund_centralbank_init_deposit' board\n");
1262  switch(rc) {
1263  case MB_ERR_INVALID:
1264  fprintf(stderr, "\t reason: 'fund_centralbank_init_deposit' board has not been created?\n");
1265  break;
1266  case MB_ERR_MEMALLOC:
1267  fprintf(stderr, "\t reason: out of memory\n");
1268  break;
1269  case MB_ERR_LOCKED:
1270  fprintf(stderr, "\t reason: 'fund_centralbank_init_deposit' board is locked\n");
1271  break;
1272  case MB_ERR_INTERNAL:
1273  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1274  break;
1275  default:
1276  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1277  break;
1278  }
1279 
1280 
1281  exit(rc);
1282  }
1283  #endif
1284 }
1285 
1286 inline static m_fund_centralbank_init_deposit* getInternalMessage_fund_centralbank_init_deposit(void)
1287 {
1288  static m_fund_centralbank_init_deposit *msg_prev = NULL;
1289  union pu_fund_centralbank_init_deposit msg_pu;
1290  int rc;
1291 
1292  /* deallocate previously returned message */
1293  if (msg_prev != NULL)
1294  {
1295  free(msg_prev);
1296  }
1297  else
1298  {
1299  rc = MB_Iterator_Rewind(i_fund_centralbank_init_deposit);
1300  #ifdef ERRCHECK
1301  if (rc != MB_SUCCESS)
1302  {
1303  fprintf(stderr, "ERROR: Could not rewind 'fund_centralbank_init_deposit' Iterator\n");
1304  switch(rc) {
1305  case MB_ERR_INVALID:
1306  fprintf(stderr, "\t reason: 'fund_centralbank_init_deposit' Iterator has not been created?\n");
1307  break;
1308  default:
1309  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1310  break;
1311  }
1312 
1313 
1314  exit(rc);
1315  }
1316  #endif
1317  }
1318 
1319  /* get next message from iterator */
1320  rc = MB_Iterator_GetMessage(i_fund_centralbank_init_deposit, &(msg_pu.ptr_anon));
1321  #ifdef ERRCHECK
1322  if (rc != MB_SUCCESS)
1323  {
1324  fprintf(stderr, "ERROR: Could not get message from 'fund_centralbank_init_deposit' Iterator\n");
1325  switch(rc) {
1326  case MB_ERR_INVALID:
1327  fprintf(stderr, "\t reason: 'fund_centralbank_init_deposit' Iterator has not been created?\n");
1328  break;
1329  case MB_ERR_MEMALLOC:
1330  fprintf(stderr, "\t reason: out of memory\n");
1331  break;
1332  default:
1333  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1334  break;
1335  }
1336 
1337 
1338  exit(rc);
1339  }
1340  #endif
1341 
1342  /* store pointer so memory can be deallocated later */
1343  msg_prev = msg_pu.ptr;
1344 
1345  return msg_pu.ptr;
1346 }
1347 
1353 {
1354  return getInternalMessage_fund_centralbank_init_deposit();
1355 }
1356 
1363 {
1364  return getInternalMessage_fund_centralbank_init_deposit();
1365 }
1366 
1367 
1368 /* Box filtering functions */
1369 
1370 
1371 
1372 
1374 {
1376  void *ptr_anon;
1377 };
1378 
1384 {
1385  int rc;
1387 
1388  msg.amount = amount;
1389 
1390 
1391  rc = MB_AddMessage(b_fund_centralbank_update_deposit, &msg);
1392  #ifdef ERRCHECK
1393  if (rc != MB_SUCCESS)
1394  {
1395  fprintf(stderr, "ERROR: Could not add message to 'fund_centralbank_update_deposit' board\n");
1396  switch(rc) {
1397  case MB_ERR_INVALID:
1398  fprintf(stderr, "\t reason: 'fund_centralbank_update_deposit' board has not been created?\n");
1399  break;
1400  case MB_ERR_MEMALLOC:
1401  fprintf(stderr, "\t reason: out of memory\n");
1402  break;
1403  case MB_ERR_LOCKED:
1404  fprintf(stderr, "\t reason: 'fund_centralbank_update_deposit' board is locked\n");
1405  break;
1406  case MB_ERR_INTERNAL:
1407  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1408  break;
1409  default:
1410  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1411  break;
1412  }
1413 
1414 
1415  exit(rc);
1416  }
1417  #endif
1418 }
1419 
1420 inline static m_fund_centralbank_update_deposit* getInternalMessage_fund_centralbank_update_deposit(void)
1421 {
1422  static m_fund_centralbank_update_deposit *msg_prev = NULL;
1424  int rc;
1425 
1426  /* deallocate previously returned message */
1427  if (msg_prev != NULL)
1428  {
1429  free(msg_prev);
1430  }
1431  else
1432  {
1433  rc = MB_Iterator_Rewind(i_fund_centralbank_update_deposit);
1434  #ifdef ERRCHECK
1435  if (rc != MB_SUCCESS)
1436  {
1437  fprintf(stderr, "ERROR: Could not rewind 'fund_centralbank_update_deposit' Iterator\n");
1438  switch(rc) {
1439  case MB_ERR_INVALID:
1440  fprintf(stderr, "\t reason: 'fund_centralbank_update_deposit' Iterator has not been created?\n");
1441  break;
1442  default:
1443  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1444  break;
1445  }
1446 
1447 
1448  exit(rc);
1449  }
1450  #endif
1451  }
1452 
1453  /* get next message from iterator */
1454  rc = MB_Iterator_GetMessage(i_fund_centralbank_update_deposit, &(msg_pu.ptr_anon));
1455  #ifdef ERRCHECK
1456  if (rc != MB_SUCCESS)
1457  {
1458  fprintf(stderr, "ERROR: Could not get message from 'fund_centralbank_update_deposit' Iterator\n");
1459  switch(rc) {
1460  case MB_ERR_INVALID:
1461  fprintf(stderr, "\t reason: 'fund_centralbank_update_deposit' Iterator has not been created?\n");
1462  break;
1463  case MB_ERR_MEMALLOC:
1464  fprintf(stderr, "\t reason: out of memory\n");
1465  break;
1466  default:
1467  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1468  break;
1469  }
1470 
1471 
1472  exit(rc);
1473  }
1474  #endif
1475 
1476  /* store pointer so memory can be deallocated later */
1477  msg_prev = msg_pu.ptr;
1478 
1479  return msg_pu.ptr;
1480 }
1481 
1487 {
1488  return getInternalMessage_fund_centralbank_update_deposit();
1489 }
1490 
1497 {
1498  return getInternalMessage_fund_centralbank_update_deposit();
1499 }
1500 
1501 
1502 /* Box filtering functions */
1503 
1504 
1505 
1506 
1508 {
1510  void *ptr_anon;
1511 };
1512 
1518 {
1519  int rc;
1521 
1522  msg.amount = amount;
1523 
1524 
1525  rc = MB_AddMessage(b_gov_centralbank_init_deposit, &msg);
1526  #ifdef ERRCHECK
1527  if (rc != MB_SUCCESS)
1528  {
1529  fprintf(stderr, "ERROR: Could not add message to 'gov_centralbank_init_deposit' board\n");
1530  switch(rc) {
1531  case MB_ERR_INVALID:
1532  fprintf(stderr, "\t reason: 'gov_centralbank_init_deposit' board has not been created?\n");
1533  break;
1534  case MB_ERR_MEMALLOC:
1535  fprintf(stderr, "\t reason: out of memory\n");
1536  break;
1537  case MB_ERR_LOCKED:
1538  fprintf(stderr, "\t reason: 'gov_centralbank_init_deposit' board is locked\n");
1539  break;
1540  case MB_ERR_INTERNAL:
1541  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1542  break;
1543  default:
1544  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1545  break;
1546  }
1547 
1548 
1549  exit(rc);
1550  }
1551  #endif
1552 }
1553 
1554 inline static m_gov_centralbank_init_deposit* getInternalMessage_gov_centralbank_init_deposit(void)
1555 {
1556  static m_gov_centralbank_init_deposit *msg_prev = NULL;
1557  union pu_gov_centralbank_init_deposit msg_pu;
1558  int rc;
1559 
1560  /* deallocate previously returned message */
1561  if (msg_prev != NULL)
1562  {
1563  free(msg_prev);
1564  }
1565  else
1566  {
1567  rc = MB_Iterator_Rewind(i_gov_centralbank_init_deposit);
1568  #ifdef ERRCHECK
1569  if (rc != MB_SUCCESS)
1570  {
1571  fprintf(stderr, "ERROR: Could not rewind 'gov_centralbank_init_deposit' Iterator\n");
1572  switch(rc) {
1573  case MB_ERR_INVALID:
1574  fprintf(stderr, "\t reason: 'gov_centralbank_init_deposit' Iterator has not been created?\n");
1575  break;
1576  default:
1577  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1578  break;
1579  }
1580 
1581 
1582  exit(rc);
1583  }
1584  #endif
1585  }
1586 
1587  /* get next message from iterator */
1588  rc = MB_Iterator_GetMessage(i_gov_centralbank_init_deposit, &(msg_pu.ptr_anon));
1589  #ifdef ERRCHECK
1590  if (rc != MB_SUCCESS)
1591  {
1592  fprintf(stderr, "ERROR: Could not get message from 'gov_centralbank_init_deposit' Iterator\n");
1593  switch(rc) {
1594  case MB_ERR_INVALID:
1595  fprintf(stderr, "\t reason: 'gov_centralbank_init_deposit' Iterator has not been created?\n");
1596  break;
1597  case MB_ERR_MEMALLOC:
1598  fprintf(stderr, "\t reason: out of memory\n");
1599  break;
1600  default:
1601  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1602  break;
1603  }
1604 
1605 
1606  exit(rc);
1607  }
1608  #endif
1609 
1610  /* store pointer so memory can be deallocated later */
1611  msg_prev = msg_pu.ptr;
1612 
1613  return msg_pu.ptr;
1614 }
1615 
1621 {
1622  return getInternalMessage_gov_centralbank_init_deposit();
1623 }
1624 
1631 {
1632  return getInternalMessage_gov_centralbank_init_deposit();
1633 }
1634 
1635 
1636 /* Box filtering functions */
1637 
1638 
1639 
1640 
1642 {
1644  void *ptr_anon;
1645 };
1646 
1652 {
1653  int rc;
1655 
1656  msg.amount = amount;
1657 
1658 
1659  rc = MB_AddMessage(b_gov_centralbank_update_deposit, &msg);
1660  #ifdef ERRCHECK
1661  if (rc != MB_SUCCESS)
1662  {
1663  fprintf(stderr, "ERROR: Could not add message to 'gov_centralbank_update_deposit' board\n");
1664  switch(rc) {
1665  case MB_ERR_INVALID:
1666  fprintf(stderr, "\t reason: 'gov_centralbank_update_deposit' board has not been created?\n");
1667  break;
1668  case MB_ERR_MEMALLOC:
1669  fprintf(stderr, "\t reason: out of memory\n");
1670  break;
1671  case MB_ERR_LOCKED:
1672  fprintf(stderr, "\t reason: 'gov_centralbank_update_deposit' board is locked\n");
1673  break;
1674  case MB_ERR_INTERNAL:
1675  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1676  break;
1677  default:
1678  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1679  break;
1680  }
1681 
1682 
1683  exit(rc);
1684  }
1685  #endif
1686 }
1687 
1688 inline static m_gov_centralbank_update_deposit* getInternalMessage_gov_centralbank_update_deposit(void)
1689 {
1690  static m_gov_centralbank_update_deposit *msg_prev = NULL;
1691  union pu_gov_centralbank_update_deposit msg_pu;
1692  int rc;
1693 
1694  /* deallocate previously returned message */
1695  if (msg_prev != NULL)
1696  {
1697  free(msg_prev);
1698  }
1699  else
1700  {
1701  rc = MB_Iterator_Rewind(i_gov_centralbank_update_deposit);
1702  #ifdef ERRCHECK
1703  if (rc != MB_SUCCESS)
1704  {
1705  fprintf(stderr, "ERROR: Could not rewind 'gov_centralbank_update_deposit' Iterator\n");
1706  switch(rc) {
1707  case MB_ERR_INVALID:
1708  fprintf(stderr, "\t reason: 'gov_centralbank_update_deposit' Iterator has not been created?\n");
1709  break;
1710  default:
1711  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1712  break;
1713  }
1714 
1715 
1716  exit(rc);
1717  }
1718  #endif
1719  }
1720 
1721  /* get next message from iterator */
1722  rc = MB_Iterator_GetMessage(i_gov_centralbank_update_deposit, &(msg_pu.ptr_anon));
1723  #ifdef ERRCHECK
1724  if (rc != MB_SUCCESS)
1725  {
1726  fprintf(stderr, "ERROR: Could not get message from 'gov_centralbank_update_deposit' Iterator\n");
1727  switch(rc) {
1728  case MB_ERR_INVALID:
1729  fprintf(stderr, "\t reason: 'gov_centralbank_update_deposit' Iterator has not been created?\n");
1730  break;
1731  case MB_ERR_MEMALLOC:
1732  fprintf(stderr, "\t reason: out of memory\n");
1733  break;
1734  default:
1735  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1736  break;
1737  }
1738 
1739 
1740  exit(rc);
1741  }
1742  #endif
1743 
1744  /* store pointer so memory can be deallocated later */
1745  msg_prev = msg_pu.ptr;
1746 
1747  return msg_pu.ptr;
1748 }
1749 
1755 {
1756  return getInternalMessage_gov_centralbank_update_deposit();
1757 }
1758 
1765 {
1766  return getInternalMessage_gov_centralbank_update_deposit();
1767 }
1768 
1769 
1770 /* Box filtering functions */
1771 
1772 
1773 
1774 
1776 {
1778  void *ptr_anon;
1779 };
1780 
1785 void add_interest_rate_message(double rate)
1786 {
1787  int rc;
1788  m_interest_rate msg;
1789 
1790  msg.rate = rate;
1791 
1792 
1793  rc = MB_AddMessage(b_interest_rate, &msg);
1794  #ifdef ERRCHECK
1795  if (rc != MB_SUCCESS)
1796  {
1797  fprintf(stderr, "ERROR: Could not add message to 'interest_rate' board\n");
1798  switch(rc) {
1799  case MB_ERR_INVALID:
1800  fprintf(stderr, "\t reason: 'interest_rate' board has not been created?\n");
1801  break;
1802  case MB_ERR_MEMALLOC:
1803  fprintf(stderr, "\t reason: out of memory\n");
1804  break;
1805  case MB_ERR_LOCKED:
1806  fprintf(stderr, "\t reason: 'interest_rate' board is locked\n");
1807  break;
1808  case MB_ERR_INTERNAL:
1809  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1810  break;
1811  default:
1812  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1813  break;
1814  }
1815 
1816 
1817  exit(rc);
1818  }
1819  #endif
1820 }
1821 
1822 inline static m_interest_rate* getInternalMessage_interest_rate(void)
1823 {
1824  static m_interest_rate *msg_prev = NULL;
1825  union pu_interest_rate msg_pu;
1826  int rc;
1827 
1828  /* deallocate previously returned message */
1829  if (msg_prev != NULL)
1830  {
1831  free(msg_prev);
1832  }
1833  else
1834  {
1835  rc = MB_Iterator_Rewind(i_interest_rate);
1836  #ifdef ERRCHECK
1837  if (rc != MB_SUCCESS)
1838  {
1839  fprintf(stderr, "ERROR: Could not rewind 'interest_rate' Iterator\n");
1840  switch(rc) {
1841  case MB_ERR_INVALID:
1842  fprintf(stderr, "\t reason: 'interest_rate' Iterator has not been created?\n");
1843  break;
1844  default:
1845  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1846  break;
1847  }
1848 
1849 
1850  exit(rc);
1851  }
1852  #endif
1853  }
1854 
1855  /* get next message from iterator */
1856  rc = MB_Iterator_GetMessage(i_interest_rate, &(msg_pu.ptr_anon));
1857  #ifdef ERRCHECK
1858  if (rc != MB_SUCCESS)
1859  {
1860  fprintf(stderr, "ERROR: Could not get message from 'interest_rate' Iterator\n");
1861  switch(rc) {
1862  case MB_ERR_INVALID:
1863  fprintf(stderr, "\t reason: 'interest_rate' Iterator has not been created?\n");
1864  break;
1865  case MB_ERR_MEMALLOC:
1866  fprintf(stderr, "\t reason: out of memory\n");
1867  break;
1868  default:
1869  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
1870  break;
1871  }
1872 
1873 
1874  exit(rc);
1875  }
1876  #endif
1877 
1878  /* store pointer so memory can be deallocated later */
1879  msg_prev = msg_pu.ptr;
1880 
1881  return msg_pu.ptr;
1882 }
1883 
1889 {
1890  return getInternalMessage_interest_rate();
1891 }
1892 
1899 {
1900  return getInternalMessage_interest_rate();
1901 }
1902 
1903 
1904 /* Box filtering functions */
1905 
1906 
1907 
1908 
1910 {
1912  void *ptr_anon;
1913 };
1914 
1920 {
1921  int rc;
1922  m_capital_tax_rate msg;
1923 
1924  msg.value = value;
1925 
1926 
1927  rc = MB_AddMessage(b_capital_tax_rate, &msg);
1928  #ifdef ERRCHECK
1929  if (rc != MB_SUCCESS)
1930  {
1931  fprintf(stderr, "ERROR: Could not add message to 'capital_tax_rate' board\n");
1932  switch(rc) {
1933  case MB_ERR_INVALID:
1934  fprintf(stderr, "\t reason: 'capital_tax_rate' board has not been created?\n");
1935  break;
1936  case MB_ERR_MEMALLOC:
1937  fprintf(stderr, "\t reason: out of memory\n");
1938  break;
1939  case MB_ERR_LOCKED:
1940  fprintf(stderr, "\t reason: 'capital_tax_rate' board is locked\n");
1941  break;
1942  case MB_ERR_INTERNAL:
1943  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
1944  break;
1945  default:
1946  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
1947  break;
1948  }
1949 
1950 
1951  exit(rc);
1952  }
1953  #endif
1954 }
1955 
1956 inline static m_capital_tax_rate* getInternalMessage_capital_tax_rate(void)
1957 {
1958  static m_capital_tax_rate *msg_prev = NULL;
1959  union pu_capital_tax_rate msg_pu;
1960  int rc;
1961 
1962  /* deallocate previously returned message */
1963  if (msg_prev != NULL)
1964  {
1965  free(msg_prev);
1966  }
1967  else
1968  {
1969  rc = MB_Iterator_Rewind(i_capital_tax_rate);
1970  #ifdef ERRCHECK
1971  if (rc != MB_SUCCESS)
1972  {
1973  fprintf(stderr, "ERROR: Could not rewind 'capital_tax_rate' Iterator\n");
1974  switch(rc) {
1975  case MB_ERR_INVALID:
1976  fprintf(stderr, "\t reason: 'capital_tax_rate' Iterator has not been created?\n");
1977  break;
1978  default:
1979  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
1980  break;
1981  }
1982 
1983 
1984  exit(rc);
1985  }
1986  #endif
1987  }
1988 
1989  /* get next message from iterator */
1990  rc = MB_Iterator_GetMessage(i_capital_tax_rate, &(msg_pu.ptr_anon));
1991  #ifdef ERRCHECK
1992  if (rc != MB_SUCCESS)
1993  {
1994  fprintf(stderr, "ERROR: Could not get message from 'capital_tax_rate' Iterator\n");
1995  switch(rc) {
1996  case MB_ERR_INVALID:
1997  fprintf(stderr, "\t reason: 'capital_tax_rate' Iterator has not been created?\n");
1998  break;
1999  case MB_ERR_MEMALLOC:
2000  fprintf(stderr, "\t reason: out of memory\n");
2001  break;
2002  default:
2003  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2004  break;
2005  }
2006 
2007 
2008  exit(rc);
2009  }
2010  #endif
2011 
2012  /* store pointer so memory can be deallocated later */
2013  msg_prev = msg_pu.ptr;
2014 
2015  return msg_pu.ptr;
2016 }
2017 
2023 {
2024  return getInternalMessage_capital_tax_rate();
2025 }
2026 
2033 {
2034  return getInternalMessage_capital_tax_rate();
2035 }
2036 
2037 
2038 /* Box filtering functions */
2039 
2040 
2041 
2042 
2044 {
2046  void *ptr_anon;
2047 };
2048 
2054 {
2055  int rc;
2056  m_labour_tax_rate msg;
2057 
2058  msg.value = value;
2059 
2060 
2061  rc = MB_AddMessage(b_labour_tax_rate, &msg);
2062  #ifdef ERRCHECK
2063  if (rc != MB_SUCCESS)
2064  {
2065  fprintf(stderr, "ERROR: Could not add message to 'labour_tax_rate' board\n");
2066  switch(rc) {
2067  case MB_ERR_INVALID:
2068  fprintf(stderr, "\t reason: 'labour_tax_rate' board has not been created?\n");
2069  break;
2070  case MB_ERR_MEMALLOC:
2071  fprintf(stderr, "\t reason: out of memory\n");
2072  break;
2073  case MB_ERR_LOCKED:
2074  fprintf(stderr, "\t reason: 'labour_tax_rate' board is locked\n");
2075  break;
2076  case MB_ERR_INTERNAL:
2077  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2078  break;
2079  default:
2080  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2081  break;
2082  }
2083 
2084 
2085  exit(rc);
2086  }
2087  #endif
2088 }
2089 
2090 inline static m_labour_tax_rate* getInternalMessage_labour_tax_rate(void)
2091 {
2092  static m_labour_tax_rate *msg_prev = NULL;
2093  union pu_labour_tax_rate msg_pu;
2094  int rc;
2095 
2096  /* deallocate previously returned message */
2097  if (msg_prev != NULL)
2098  {
2099  free(msg_prev);
2100  }
2101  else
2102  {
2103  rc = MB_Iterator_Rewind(i_labour_tax_rate);
2104  #ifdef ERRCHECK
2105  if (rc != MB_SUCCESS)
2106  {
2107  fprintf(stderr, "ERROR: Could not rewind 'labour_tax_rate' Iterator\n");
2108  switch(rc) {
2109  case MB_ERR_INVALID:
2110  fprintf(stderr, "\t reason: 'labour_tax_rate' Iterator has not been created?\n");
2111  break;
2112  default:
2113  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2114  break;
2115  }
2116 
2117 
2118  exit(rc);
2119  }
2120  #endif
2121  }
2122 
2123  /* get next message from iterator */
2124  rc = MB_Iterator_GetMessage(i_labour_tax_rate, &(msg_pu.ptr_anon));
2125  #ifdef ERRCHECK
2126  if (rc != MB_SUCCESS)
2127  {
2128  fprintf(stderr, "ERROR: Could not get message from 'labour_tax_rate' Iterator\n");
2129  switch(rc) {
2130  case MB_ERR_INVALID:
2131  fprintf(stderr, "\t reason: 'labour_tax_rate' Iterator has not been created?\n");
2132  break;
2133  case MB_ERR_MEMALLOC:
2134  fprintf(stderr, "\t reason: out of memory\n");
2135  break;
2136  default:
2137  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2138  break;
2139  }
2140 
2141 
2142  exit(rc);
2143  }
2144  #endif
2145 
2146  /* store pointer so memory can be deallocated later */
2147  msg_prev = msg_pu.ptr;
2148 
2149  return msg_pu.ptr;
2150 }
2151 
2157 {
2158  return getInternalMessage_labour_tax_rate();
2159 }
2160 
2167 {
2168  return getInternalMessage_labour_tax_rate();
2169 }
2170 
2171 
2172 /* Box filtering functions */
2173 
2174 
2175 
2176 
2178 {
2180  void *ptr_anon;
2181 };
2182 
2188 {
2189  int rc;
2191 
2192  msg.household_id = household_id;
2193 
2194 
2195  rc = MB_AddMessage(b_household_jpoffice_id, &msg);
2196  #ifdef ERRCHECK
2197  if (rc != MB_SUCCESS)
2198  {
2199  fprintf(stderr, "ERROR: Could not add message to 'household_jpoffice_id' board\n");
2200  switch(rc) {
2201  case MB_ERR_INVALID:
2202  fprintf(stderr, "\t reason: 'household_jpoffice_id' board has not been created?\n");
2203  break;
2204  case MB_ERR_MEMALLOC:
2205  fprintf(stderr, "\t reason: out of memory\n");
2206  break;
2207  case MB_ERR_LOCKED:
2208  fprintf(stderr, "\t reason: 'household_jpoffice_id' board is locked\n");
2209  break;
2210  case MB_ERR_INTERNAL:
2211  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2212  break;
2213  default:
2214  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2215  break;
2216  }
2217 
2218 
2219  exit(rc);
2220  }
2221  #endif
2222 }
2223 
2224 inline static m_household_jpoffice_id* getInternalMessage_household_jpoffice_id(void)
2225 {
2226  static m_household_jpoffice_id *msg_prev = NULL;
2227  union pu_household_jpoffice_id msg_pu;
2228  int rc;
2229 
2230  /* deallocate previously returned message */
2231  if (msg_prev != NULL)
2232  {
2233  free(msg_prev);
2234  }
2235  else
2236  {
2237  rc = MB_Iterator_Rewind(i_household_jpoffice_id);
2238  #ifdef ERRCHECK
2239  if (rc != MB_SUCCESS)
2240  {
2241  fprintf(stderr, "ERROR: Could not rewind 'household_jpoffice_id' Iterator\n");
2242  switch(rc) {
2243  case MB_ERR_INVALID:
2244  fprintf(stderr, "\t reason: 'household_jpoffice_id' Iterator has not been created?\n");
2245  break;
2246  default:
2247  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2248  break;
2249  }
2250 
2251 
2252  exit(rc);
2253  }
2254  #endif
2255  }
2256 
2257  /* get next message from iterator */
2258  rc = MB_Iterator_GetMessage(i_household_jpoffice_id, &(msg_pu.ptr_anon));
2259  #ifdef ERRCHECK
2260  if (rc != MB_SUCCESS)
2261  {
2262  fprintf(stderr, "ERROR: Could not get message from 'household_jpoffice_id' Iterator\n");
2263  switch(rc) {
2264  case MB_ERR_INVALID:
2265  fprintf(stderr, "\t reason: 'household_jpoffice_id' Iterator has not been created?\n");
2266  break;
2267  case MB_ERR_MEMALLOC:
2268  fprintf(stderr, "\t reason: out of memory\n");
2269  break;
2270  default:
2271  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2272  break;
2273  }
2274 
2275 
2276  exit(rc);
2277  }
2278  #endif
2279 
2280  /* store pointer so memory can be deallocated later */
2281  msg_prev = msg_pu.ptr;
2282 
2283  return msg_pu.ptr;
2284 }
2285 
2291 {
2292  return getInternalMessage_household_jpoffice_id();
2293 }
2294 
2301 {
2302  return getInternalMessage_household_jpoffice_id();
2303 }
2304 
2305 
2306 /* Box filtering functions */
2307 
2308 
2309 
2310 
2312 {
2314  void *ptr_anon;
2315 };
2316 
2323 void add_jpoffice_household_employer_message(int household_id, int employer_id, int position)
2324 {
2325  int rc;
2327 
2328  msg.household_id = household_id;
2329  msg.employer_id = employer_id;
2330  msg.position = position;
2331 
2332 
2333  rc = MB_AddMessage(b_jpoffice_household_employer, &msg);
2334  #ifdef ERRCHECK
2335  if (rc != MB_SUCCESS)
2336  {
2337  fprintf(stderr, "ERROR: Could not add message to 'jpoffice_household_employer' board\n");
2338  switch(rc) {
2339  case MB_ERR_INVALID:
2340  fprintf(stderr, "\t reason: 'jpoffice_household_employer' board has not been created?\n");
2341  break;
2342  case MB_ERR_MEMALLOC:
2343  fprintf(stderr, "\t reason: out of memory\n");
2344  break;
2345  case MB_ERR_LOCKED:
2346  fprintf(stderr, "\t reason: 'jpoffice_household_employer' board is locked\n");
2347  break;
2348  case MB_ERR_INTERNAL:
2349  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2350  break;
2351  default:
2352  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2353  break;
2354  }
2355 
2356 
2357  exit(rc);
2358  }
2359  #endif
2360 }
2361 
2362 inline static m_jpoffice_household_employer* getInternalMessage_jpoffice_household_employer(void)
2363 {
2364  static m_jpoffice_household_employer *msg_prev = NULL;
2365  union pu_jpoffice_household_employer msg_pu;
2366  int rc;
2367 
2368  /* deallocate previously returned message */
2369  if (msg_prev != NULL)
2370  {
2371  free(msg_prev);
2372  }
2373  else
2374  {
2375  rc = MB_Iterator_Rewind(i_jpoffice_household_employer);
2376  #ifdef ERRCHECK
2377  if (rc != MB_SUCCESS)
2378  {
2379  fprintf(stderr, "ERROR: Could not rewind 'jpoffice_household_employer' Iterator\n");
2380  switch(rc) {
2381  case MB_ERR_INVALID:
2382  fprintf(stderr, "\t reason: 'jpoffice_household_employer' Iterator has not been created?\n");
2383  break;
2384  default:
2385  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2386  break;
2387  }
2388 
2389 
2390  exit(rc);
2391  }
2392  #endif
2393  }
2394 
2395  /* get next message from iterator */
2396  rc = MB_Iterator_GetMessage(i_jpoffice_household_employer, &(msg_pu.ptr_anon));
2397  #ifdef ERRCHECK
2398  if (rc != MB_SUCCESS)
2399  {
2400  fprintf(stderr, "ERROR: Could not get message from 'jpoffice_household_employer' Iterator\n");
2401  switch(rc) {
2402  case MB_ERR_INVALID:
2403  fprintf(stderr, "\t reason: 'jpoffice_household_employer' Iterator has not been created?\n");
2404  break;
2405  case MB_ERR_MEMALLOC:
2406  fprintf(stderr, "\t reason: out of memory\n");
2407  break;
2408  default:
2409  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2410  break;
2411  }
2412 
2413 
2414  exit(rc);
2415  }
2416  #endif
2417 
2418  /* store pointer so memory can be deallocated later */
2419  msg_prev = msg_pu.ptr;
2420 
2421  return msg_pu.ptr;
2422 }
2423 
2429 {
2430  return getInternalMessage_jpoffice_household_employer();
2431 }
2432 
2439 {
2440  return getInternalMessage_jpoffice_household_employer();
2441 }
2442 
2443 
2444 /* Box filtering functions */
2445 
2446 
2447 
2448 
2450 {
2452  void *ptr_anon;
2453 };
2454 
2460 void add_firm_jpoffice_id_message(int firm_id, int isconstructor)
2461 {
2462  int rc;
2463  m_firm_jpoffice_id msg;
2464 
2465  msg.firm_id = firm_id;
2466  msg.isconstructor = isconstructor;
2467 
2468 
2469  rc = MB_AddMessage(b_firm_jpoffice_id, &msg);
2470  #ifdef ERRCHECK
2471  if (rc != MB_SUCCESS)
2472  {
2473  fprintf(stderr, "ERROR: Could not add message to 'firm_jpoffice_id' board\n");
2474  switch(rc) {
2475  case MB_ERR_INVALID:
2476  fprintf(stderr, "\t reason: 'firm_jpoffice_id' board has not been created?\n");
2477  break;
2478  case MB_ERR_MEMALLOC:
2479  fprintf(stderr, "\t reason: out of memory\n");
2480  break;
2481  case MB_ERR_LOCKED:
2482  fprintf(stderr, "\t reason: 'firm_jpoffice_id' board is locked\n");
2483  break;
2484  case MB_ERR_INTERNAL:
2485  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2486  break;
2487  default:
2488  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2489  break;
2490  }
2491 
2492 
2493  exit(rc);
2494  }
2495  #endif
2496 }
2497 
2498 inline static m_firm_jpoffice_id* getInternalMessage_firm_jpoffice_id(void)
2499 {
2500  static m_firm_jpoffice_id *msg_prev = NULL;
2501  union pu_firm_jpoffice_id msg_pu;
2502  int rc;
2503 
2504  /* deallocate previously returned message */
2505  if (msg_prev != NULL)
2506  {
2507  free(msg_prev);
2508  }
2509  else
2510  {
2511  rc = MB_Iterator_Rewind(i_firm_jpoffice_id);
2512  #ifdef ERRCHECK
2513  if (rc != MB_SUCCESS)
2514  {
2515  fprintf(stderr, "ERROR: Could not rewind 'firm_jpoffice_id' Iterator\n");
2516  switch(rc) {
2517  case MB_ERR_INVALID:
2518  fprintf(stderr, "\t reason: 'firm_jpoffice_id' Iterator has not been created?\n");
2519  break;
2520  default:
2521  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2522  break;
2523  }
2524 
2525 
2526  exit(rc);
2527  }
2528  #endif
2529  }
2530 
2531  /* get next message from iterator */
2532  rc = MB_Iterator_GetMessage(i_firm_jpoffice_id, &(msg_pu.ptr_anon));
2533  #ifdef ERRCHECK
2534  if (rc != MB_SUCCESS)
2535  {
2536  fprintf(stderr, "ERROR: Could not get message from 'firm_jpoffice_id' Iterator\n");
2537  switch(rc) {
2538  case MB_ERR_INVALID:
2539  fprintf(stderr, "\t reason: 'firm_jpoffice_id' Iterator has not been created?\n");
2540  break;
2541  case MB_ERR_MEMALLOC:
2542  fprintf(stderr, "\t reason: out of memory\n");
2543  break;
2544  default:
2545  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2546  break;
2547  }
2548 
2549 
2550  exit(rc);
2551  }
2552  #endif
2553 
2554  /* store pointer so memory can be deallocated later */
2555  msg_prev = msg_pu.ptr;
2556 
2557  return msg_pu.ptr;
2558 }
2559 
2565 {
2566  return getInternalMessage_firm_jpoffice_id();
2567 }
2568 
2575 {
2576  return getInternalMessage_firm_jpoffice_id();
2577 }
2578 
2579 
2580 /* Box filtering functions */
2581 
2582 
2583 
2584 
2586 {
2588  void *ptr_anon;
2589 };
2590 
2597 void add_jpoffice_firm_employee_message(int firm_id, int employee_id, int position)
2598 {
2599  int rc;
2601 
2602  msg.firm_id = firm_id;
2603  msg.employee_id = employee_id;
2604  msg.position = position;
2605 
2606 
2607  rc = MB_AddMessage(b_jpoffice_firm_employee, &msg);
2608  #ifdef ERRCHECK
2609  if (rc != MB_SUCCESS)
2610  {
2611  fprintf(stderr, "ERROR: Could not add message to 'jpoffice_firm_employee' board\n");
2612  switch(rc) {
2613  case MB_ERR_INVALID:
2614  fprintf(stderr, "\t reason: 'jpoffice_firm_employee' board has not been created?\n");
2615  break;
2616  case MB_ERR_MEMALLOC:
2617  fprintf(stderr, "\t reason: out of memory\n");
2618  break;
2619  case MB_ERR_LOCKED:
2620  fprintf(stderr, "\t reason: 'jpoffice_firm_employee' board is locked\n");
2621  break;
2622  case MB_ERR_INTERNAL:
2623  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2624  break;
2625  default:
2626  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2627  break;
2628  }
2629 
2630 
2631  exit(rc);
2632  }
2633  #endif
2634 }
2635 
2636 inline static m_jpoffice_firm_employee* getInternalMessage_jpoffice_firm_employee(void)
2637 {
2638  static m_jpoffice_firm_employee *msg_prev = NULL;
2639  union pu_jpoffice_firm_employee msg_pu;
2640  int rc;
2641 
2642  /* deallocate previously returned message */
2643  if (msg_prev != NULL)
2644  {
2645  free(msg_prev);
2646  }
2647  else
2648  {
2649  rc = MB_Iterator_Rewind(i_jpoffice_firm_employee);
2650  #ifdef ERRCHECK
2651  if (rc != MB_SUCCESS)
2652  {
2653  fprintf(stderr, "ERROR: Could not rewind 'jpoffice_firm_employee' Iterator\n");
2654  switch(rc) {
2655  case MB_ERR_INVALID:
2656  fprintf(stderr, "\t reason: 'jpoffice_firm_employee' Iterator has not been created?\n");
2657  break;
2658  default:
2659  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2660  break;
2661  }
2662 
2663 
2664  exit(rc);
2665  }
2666  #endif
2667  }
2668 
2669  /* get next message from iterator */
2670  rc = MB_Iterator_GetMessage(i_jpoffice_firm_employee, &(msg_pu.ptr_anon));
2671  #ifdef ERRCHECK
2672  if (rc != MB_SUCCESS)
2673  {
2674  fprintf(stderr, "ERROR: Could not get message from 'jpoffice_firm_employee' Iterator\n");
2675  switch(rc) {
2676  case MB_ERR_INVALID:
2677  fprintf(stderr, "\t reason: 'jpoffice_firm_employee' Iterator has not been created?\n");
2678  break;
2679  case MB_ERR_MEMALLOC:
2680  fprintf(stderr, "\t reason: out of memory\n");
2681  break;
2682  default:
2683  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2684  break;
2685  }
2686 
2687 
2688  exit(rc);
2689  }
2690  #endif
2691 
2692  /* store pointer so memory can be deallocated later */
2693  msg_prev = msg_pu.ptr;
2694 
2695  return msg_pu.ptr;
2696 }
2697 
2703 {
2704  return getInternalMessage_jpoffice_firm_employee();
2705 }
2706 
2713 {
2714  return getInternalMessage_jpoffice_firm_employee();
2715 }
2716 
2717 
2718 /* Box filtering functions */
2719 
2720 
2721 
2722 
2723 union pu_buy
2724 {
2726  void *ptr_anon;
2727 };
2728 
2734 void add_buy_message(int id, double budget)
2735 {
2736  int rc;
2737  m_buy msg;
2738 
2739  msg.id = id;
2740  msg.budget = budget;
2741 
2742 
2743  rc = MB_AddMessage(b_buy, &msg);
2744  #ifdef ERRCHECK
2745  if (rc != MB_SUCCESS)
2746  {
2747  fprintf(stderr, "ERROR: Could not add message to 'buy' board\n");
2748  switch(rc) {
2749  case MB_ERR_INVALID:
2750  fprintf(stderr, "\t reason: 'buy' board has not been created?\n");
2751  break;
2752  case MB_ERR_MEMALLOC:
2753  fprintf(stderr, "\t reason: out of memory\n");
2754  break;
2755  case MB_ERR_LOCKED:
2756  fprintf(stderr, "\t reason: 'buy' board is locked\n");
2757  break;
2758  case MB_ERR_INTERNAL:
2759  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2760  break;
2761  default:
2762  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2763  break;
2764  }
2765 
2766 
2767  exit(rc);
2768  }
2769  #endif
2770 }
2771 
2772 inline static m_buy* getInternalMessage_buy(void)
2773 {
2774  static m_buy *msg_prev = NULL;
2775  union pu_buy msg_pu;
2776  int rc;
2777 
2778  /* deallocate previously returned message */
2779  if (msg_prev != NULL)
2780  {
2781  free(msg_prev);
2782  }
2783  else
2784  {
2785  rc = MB_Iterator_Rewind(i_buy);
2786  #ifdef ERRCHECK
2787  if (rc != MB_SUCCESS)
2788  {
2789  fprintf(stderr, "ERROR: Could not rewind 'buy' Iterator\n");
2790  switch(rc) {
2791  case MB_ERR_INVALID:
2792  fprintf(stderr, "\t reason: 'buy' Iterator has not been created?\n");
2793  break;
2794  default:
2795  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2796  break;
2797  }
2798 
2799 
2800  exit(rc);
2801  }
2802  #endif
2803  }
2804 
2805  /* get next message from iterator */
2806  rc = MB_Iterator_GetMessage(i_buy, &(msg_pu.ptr_anon));
2807  #ifdef ERRCHECK
2808  if (rc != MB_SUCCESS)
2809  {
2810  fprintf(stderr, "ERROR: Could not get message from 'buy' Iterator\n");
2811  switch(rc) {
2812  case MB_ERR_INVALID:
2813  fprintf(stderr, "\t reason: 'buy' Iterator has not been created?\n");
2814  break;
2815  case MB_ERR_MEMALLOC:
2816  fprintf(stderr, "\t reason: out of memory\n");
2817  break;
2818  default:
2819  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2820  break;
2821  }
2822 
2823 
2824  exit(rc);
2825  }
2826  #endif
2827 
2828  /* store pointer so memory can be deallocated later */
2829  msg_prev = msg_pu.ptr;
2830 
2831  return msg_pu.ptr;
2832 }
2833 
2839 {
2840  return getInternalMessage_buy();
2841 }
2842 
2849 {
2850  return getInternalMessage_buy();
2851 }
2852 
2853 
2854 /* Box filtering functions */
2855 
2856 
2857 
2858 
2860 {
2862  void *ptr_anon;
2863 };
2864 
2871 void add_bought_message(int id, double money_spent, int received_quantity)
2872 {
2873  int rc;
2874  m_bought msg;
2875 
2876  msg.id = id;
2877  msg.money_spent = money_spent;
2878  msg.received_quantity = received_quantity;
2879 
2880 
2881  rc = MB_AddMessage(b_bought, &msg);
2882  #ifdef ERRCHECK
2883  if (rc != MB_SUCCESS)
2884  {
2885  fprintf(stderr, "ERROR: Could not add message to 'bought' board\n");
2886  switch(rc) {
2887  case MB_ERR_INVALID:
2888  fprintf(stderr, "\t reason: 'bought' board has not been created?\n");
2889  break;
2890  case MB_ERR_MEMALLOC:
2891  fprintf(stderr, "\t reason: out of memory\n");
2892  break;
2893  case MB_ERR_LOCKED:
2894  fprintf(stderr, "\t reason: 'bought' board is locked\n");
2895  break;
2896  case MB_ERR_INTERNAL:
2897  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
2898  break;
2899  default:
2900  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
2901  break;
2902  }
2903 
2904 
2905  exit(rc);
2906  }
2907  #endif
2908 }
2909 
2910 inline static m_bought* getInternalMessage_bought(void)
2911 {
2912  static m_bought *msg_prev = NULL;
2913  union pu_bought msg_pu;
2914  int rc;
2915 
2916  /* deallocate previously returned message */
2917  if (msg_prev != NULL)
2918  {
2919  free(msg_prev);
2920  }
2921  else
2922  {
2923  rc = MB_Iterator_Rewind(i_bought);
2924  #ifdef ERRCHECK
2925  if (rc != MB_SUCCESS)
2926  {
2927  fprintf(stderr, "ERROR: Could not rewind 'bought' Iterator\n");
2928  switch(rc) {
2929  case MB_ERR_INVALID:
2930  fprintf(stderr, "\t reason: 'bought' Iterator has not been created?\n");
2931  break;
2932  default:
2933  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
2934  break;
2935  }
2936 
2937 
2938  exit(rc);
2939  }
2940  #endif
2941  }
2942 
2943  /* get next message from iterator */
2944  rc = MB_Iterator_GetMessage(i_bought, &(msg_pu.ptr_anon));
2945  #ifdef ERRCHECK
2946  if (rc != MB_SUCCESS)
2947  {
2948  fprintf(stderr, "ERROR: Could not get message from 'bought' Iterator\n");
2949  switch(rc) {
2950  case MB_ERR_INVALID:
2951  fprintf(stderr, "\t reason: 'bought' Iterator has not been created?\n");
2952  break;
2953  case MB_ERR_MEMALLOC:
2954  fprintf(stderr, "\t reason: out of memory\n");
2955  break;
2956  default:
2957  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
2958  break;
2959  }
2960 
2961 
2962  exit(rc);
2963  }
2964  #endif
2965 
2966  /* store pointer so memory can be deallocated later */
2967  msg_prev = msg_pu.ptr;
2968 
2969  return msg_pu.ptr;
2970 }
2971 
2977 {
2978  return getInternalMessage_bought();
2979 }
2980 
2987 {
2988  return getInternalMessage_bought();
2989 }
2990 
2991 
2992 /* Box filtering functions */
2993 
2994 
2995 
2996 
2997 union pu_sell
2998 {
3000  void *ptr_anon;
3001 };
3002 
3009 void add_sell_message(int id, double price, int inventory)
3010 {
3011  int rc;
3012  m_sell msg;
3013 
3014  msg.id = id;
3015  msg.price = price;
3016  msg.inventory = inventory;
3017 
3018 
3019  rc = MB_AddMessage(b_sell, &msg);
3020  #ifdef ERRCHECK
3021  if (rc != MB_SUCCESS)
3022  {
3023  fprintf(stderr, "ERROR: Could not add message to 'sell' board\n");
3024  switch(rc) {
3025  case MB_ERR_INVALID:
3026  fprintf(stderr, "\t reason: 'sell' board has not been created?\n");
3027  break;
3028  case MB_ERR_MEMALLOC:
3029  fprintf(stderr, "\t reason: out of memory\n");
3030  break;
3031  case MB_ERR_LOCKED:
3032  fprintf(stderr, "\t reason: 'sell' board is locked\n");
3033  break;
3034  case MB_ERR_INTERNAL:
3035  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3036  break;
3037  default:
3038  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3039  break;
3040  }
3041 
3042 
3043  exit(rc);
3044  }
3045  #endif
3046 }
3047 
3048 inline static m_sell* getInternalMessage_sell(void)
3049 {
3050  static m_sell *msg_prev = NULL;
3051  union pu_sell msg_pu;
3052  int rc;
3053 
3054  /* deallocate previously returned message */
3055  if (msg_prev != NULL)
3056  {
3057  free(msg_prev);
3058  }
3059  else
3060  {
3061  rc = MB_Iterator_Rewind(i_sell);
3062  #ifdef ERRCHECK
3063  if (rc != MB_SUCCESS)
3064  {
3065  fprintf(stderr, "ERROR: Could not rewind 'sell' Iterator\n");
3066  switch(rc) {
3067  case MB_ERR_INVALID:
3068  fprintf(stderr, "\t reason: 'sell' Iterator has not been created?\n");
3069  break;
3070  default:
3071  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3072  break;
3073  }
3074 
3075 
3076  exit(rc);
3077  }
3078  #endif
3079  }
3080 
3081  /* get next message from iterator */
3082  rc = MB_Iterator_GetMessage(i_sell, &(msg_pu.ptr_anon));
3083  #ifdef ERRCHECK
3084  if (rc != MB_SUCCESS)
3085  {
3086  fprintf(stderr, "ERROR: Could not get message from 'sell' Iterator\n");
3087  switch(rc) {
3088  case MB_ERR_INVALID:
3089  fprintf(stderr, "\t reason: 'sell' Iterator has not been created?\n");
3090  break;
3091  case MB_ERR_MEMALLOC:
3092  fprintf(stderr, "\t reason: out of memory\n");
3093  break;
3094  default:
3095  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3096  break;
3097  }
3098 
3099 
3100  exit(rc);
3101  }
3102  #endif
3103 
3104  /* store pointer so memory can be deallocated later */
3105  msg_prev = msg_pu.ptr;
3106 
3107  return msg_pu.ptr;
3108 }
3109 
3115 {
3116  return getInternalMessage_sell();
3117 }
3118 
3125 {
3126  return getInternalMessage_sell();
3127 }
3128 
3129 
3130 /* Box filtering functions */
3131 
3132 
3133 
3134 
3135 union pu_sold
3136 {
3138  void *ptr_anon;
3139 };
3140 
3146 void add_sold_message(int id, int sold_quantities)
3147 {
3148  int rc;
3149  m_sold msg;
3150 
3151  msg.id = id;
3152  msg.sold_quantities = sold_quantities;
3153 
3154 
3155  rc = MB_AddMessage(b_sold, &msg);
3156  #ifdef ERRCHECK
3157  if (rc != MB_SUCCESS)
3158  {
3159  fprintf(stderr, "ERROR: Could not add message to 'sold' board\n");
3160  switch(rc) {
3161  case MB_ERR_INVALID:
3162  fprintf(stderr, "\t reason: 'sold' board has not been created?\n");
3163  break;
3164  case MB_ERR_MEMALLOC:
3165  fprintf(stderr, "\t reason: out of memory\n");
3166  break;
3167  case MB_ERR_LOCKED:
3168  fprintf(stderr, "\t reason: 'sold' board is locked\n");
3169  break;
3170  case MB_ERR_INTERNAL:
3171  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3172  break;
3173  default:
3174  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3175  break;
3176  }
3177 
3178 
3179  exit(rc);
3180  }
3181  #endif
3182 }
3183 
3184 inline static m_sold* getInternalMessage_sold(void)
3185 {
3186  static m_sold *msg_prev = NULL;
3187  union pu_sold msg_pu;
3188  int rc;
3189 
3190  /* deallocate previously returned message */
3191  if (msg_prev != NULL)
3192  {
3193  free(msg_prev);
3194  }
3195  else
3196  {
3197  rc = MB_Iterator_Rewind(i_sold);
3198  #ifdef ERRCHECK
3199  if (rc != MB_SUCCESS)
3200  {
3201  fprintf(stderr, "ERROR: Could not rewind 'sold' Iterator\n");
3202  switch(rc) {
3203  case MB_ERR_INVALID:
3204  fprintf(stderr, "\t reason: 'sold' Iterator has not been created?\n");
3205  break;
3206  default:
3207  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3208  break;
3209  }
3210 
3211 
3212  exit(rc);
3213  }
3214  #endif
3215  }
3216 
3217  /* get next message from iterator */
3218  rc = MB_Iterator_GetMessage(i_sold, &(msg_pu.ptr_anon));
3219  #ifdef ERRCHECK
3220  if (rc != MB_SUCCESS)
3221  {
3222  fprintf(stderr, "ERROR: Could not get message from 'sold' Iterator\n");
3223  switch(rc) {
3224  case MB_ERR_INVALID:
3225  fprintf(stderr, "\t reason: 'sold' Iterator has not been created?\n");
3226  break;
3227  case MB_ERR_MEMALLOC:
3228  fprintf(stderr, "\t reason: out of memory\n");
3229  break;
3230  default:
3231  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3232  break;
3233  }
3234 
3235 
3236  exit(rc);
3237  }
3238  #endif
3239 
3240  /* store pointer so memory can be deallocated later */
3241  msg_prev = msg_pu.ptr;
3242 
3243  return msg_pu.ptr;
3244 }
3245 
3251 {
3252  return getInternalMessage_sold();
3253 }
3254 
3261 {
3262  return getInternalMessage_sold();
3263 }
3264 
3265 
3266 /* Box filtering functions */
3267 
3268 
3269 
3270 
3272 {
3274  void *ptr_anon;
3275 };
3276 
3282 void add_goods_transactions_summary_message(int quantity, double avg_price)
3283 {
3284  int rc;
3286 
3287  msg.quantity = quantity;
3288  msg.avg_price = avg_price;
3289 
3290 
3291  rc = MB_AddMessage(b_goods_transactions_summary, &msg);
3292  #ifdef ERRCHECK
3293  if (rc != MB_SUCCESS)
3294  {
3295  fprintf(stderr, "ERROR: Could not add message to 'goods_transactions_summary' board\n");
3296  switch(rc) {
3297  case MB_ERR_INVALID:
3298  fprintf(stderr, "\t reason: 'goods_transactions_summary' board has not been created?\n");
3299  break;
3300  case MB_ERR_MEMALLOC:
3301  fprintf(stderr, "\t reason: out of memory\n");
3302  break;
3303  case MB_ERR_LOCKED:
3304  fprintf(stderr, "\t reason: 'goods_transactions_summary' board is locked\n");
3305  break;
3306  case MB_ERR_INTERNAL:
3307  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3308  break;
3309  default:
3310  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3311  break;
3312  }
3313 
3314 
3315  exit(rc);
3316  }
3317  #endif
3318 }
3319 
3320 inline static m_goods_transactions_summary* getInternalMessage_goods_transactions_summary(void)
3321 {
3322  static m_goods_transactions_summary *msg_prev = NULL;
3323  union pu_goods_transactions_summary msg_pu;
3324  int rc;
3325 
3326  /* deallocate previously returned message */
3327  if (msg_prev != NULL)
3328  {
3329  free(msg_prev);
3330  }
3331  else
3332  {
3333  rc = MB_Iterator_Rewind(i_goods_transactions_summary);
3334  #ifdef ERRCHECK
3335  if (rc != MB_SUCCESS)
3336  {
3337  fprintf(stderr, "ERROR: Could not rewind 'goods_transactions_summary' Iterator\n");
3338  switch(rc) {
3339  case MB_ERR_INVALID:
3340  fprintf(stderr, "\t reason: 'goods_transactions_summary' Iterator has not been created?\n");
3341  break;
3342  default:
3343  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3344  break;
3345  }
3346 
3347 
3348  exit(rc);
3349  }
3350  #endif
3351  }
3352 
3353  /* get next message from iterator */
3354  rc = MB_Iterator_GetMessage(i_goods_transactions_summary, &(msg_pu.ptr_anon));
3355  #ifdef ERRCHECK
3356  if (rc != MB_SUCCESS)
3357  {
3358  fprintf(stderr, "ERROR: Could not get message from 'goods_transactions_summary' Iterator\n");
3359  switch(rc) {
3360  case MB_ERR_INVALID:
3361  fprintf(stderr, "\t reason: 'goods_transactions_summary' Iterator has not been created?\n");
3362  break;
3363  case MB_ERR_MEMALLOC:
3364  fprintf(stderr, "\t reason: out of memory\n");
3365  break;
3366  default:
3367  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3368  break;
3369  }
3370 
3371 
3372  exit(rc);
3373  }
3374  #endif
3375 
3376  /* store pointer so memory can be deallocated later */
3377  msg_prev = msg_pu.ptr;
3378 
3379  return msg_pu.ptr;
3380 }
3381 
3387 {
3388  return getInternalMessage_goods_transactions_summary();
3389 }
3390 
3397 {
3398  return getInternalMessage_goods_transactions_summary();
3399 }
3400 
3401 
3402 /* Box filtering functions */
3403 
3404 
3405 
3406 
3408 {
3410  void *ptr_anon;
3411 };
3412 
3418 {
3419  int rc;
3421 
3422  msg.change = change;
3423 
3424 
3425  rc = MB_AddMessage(b_centralbank_households_quarterly_cpi, &msg);
3426  #ifdef ERRCHECK
3427  if (rc != MB_SUCCESS)
3428  {
3429  fprintf(stderr, "ERROR: Could not add message to 'centralbank_households_quarterly_cpi' board\n");
3430  switch(rc) {
3431  case MB_ERR_INVALID:
3432  fprintf(stderr, "\t reason: 'centralbank_households_quarterly_cpi' board has not been created?\n");
3433  break;
3434  case MB_ERR_MEMALLOC:
3435  fprintf(stderr, "\t reason: out of memory\n");
3436  break;
3437  case MB_ERR_LOCKED:
3438  fprintf(stderr, "\t reason: 'centralbank_households_quarterly_cpi' board is locked\n");
3439  break;
3440  case MB_ERR_INTERNAL:
3441  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3442  break;
3443  default:
3444  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3445  break;
3446  }
3447 
3448 
3449  exit(rc);
3450  }
3451  #endif
3452 }
3453 
3454 inline static m_centralbank_households_quarterly_cpi* getInternalMessage_centralbank_households_quarterly_cpi(void)
3455 {
3456  static m_centralbank_households_quarterly_cpi *msg_prev = NULL;
3458  int rc;
3459 
3460  /* deallocate previously returned message */
3461  if (msg_prev != NULL)
3462  {
3463  free(msg_prev);
3464  }
3465  else
3466  {
3467  rc = MB_Iterator_Rewind(i_centralbank_households_quarterly_cpi);
3468  #ifdef ERRCHECK
3469  if (rc != MB_SUCCESS)
3470  {
3471  fprintf(stderr, "ERROR: Could not rewind 'centralbank_households_quarterly_cpi' Iterator\n");
3472  switch(rc) {
3473  case MB_ERR_INVALID:
3474  fprintf(stderr, "\t reason: 'centralbank_households_quarterly_cpi' Iterator has not been created?\n");
3475  break;
3476  default:
3477  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3478  break;
3479  }
3480 
3481 
3482  exit(rc);
3483  }
3484  #endif
3485  }
3486 
3487  /* get next message from iterator */
3488  rc = MB_Iterator_GetMessage(i_centralbank_households_quarterly_cpi, &(msg_pu.ptr_anon));
3489  #ifdef ERRCHECK
3490  if (rc != MB_SUCCESS)
3491  {
3492  fprintf(stderr, "ERROR: Could not get message from 'centralbank_households_quarterly_cpi' Iterator\n");
3493  switch(rc) {
3494  case MB_ERR_INVALID:
3495  fprintf(stderr, "\t reason: 'centralbank_households_quarterly_cpi' Iterator has not been created?\n");
3496  break;
3497  case MB_ERR_MEMALLOC:
3498  fprintf(stderr, "\t reason: out of memory\n");
3499  break;
3500  default:
3501  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3502  break;
3503  }
3504 
3505 
3506  exit(rc);
3507  }
3508  #endif
3509 
3510  /* store pointer so memory can be deallocated later */
3511  msg_prev = msg_pu.ptr;
3512 
3513  return msg_pu.ptr;
3514 }
3515 
3521 {
3522  return getInternalMessage_centralbank_households_quarterly_cpi();
3523 }
3524 
3531 {
3532  return getInternalMessage_centralbank_households_quarterly_cpi();
3533 }
3534 
3535 
3536 /* Box filtering functions */
3537 
3538 
3539 
3540 
3541 union pu_fired
3542 {
3544  void *ptr_anon;
3545 };
3546 
3551 void add_fired_message(int employee_id)
3552 {
3553  int rc;
3554  m_fired msg;
3555 
3556  msg.employee_id = employee_id;
3557 
3558 
3559  rc = MB_AddMessage(b_fired, &msg);
3560  #ifdef ERRCHECK
3561  if (rc != MB_SUCCESS)
3562  {
3563  fprintf(stderr, "ERROR: Could not add message to 'fired' board\n");
3564  switch(rc) {
3565  case MB_ERR_INVALID:
3566  fprintf(stderr, "\t reason: 'fired' board has not been created?\n");
3567  break;
3568  case MB_ERR_MEMALLOC:
3569  fprintf(stderr, "\t reason: out of memory\n");
3570  break;
3571  case MB_ERR_LOCKED:
3572  fprintf(stderr, "\t reason: 'fired' board is locked\n");
3573  break;
3574  case MB_ERR_INTERNAL:
3575  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3576  break;
3577  default:
3578  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3579  break;
3580  }
3581 
3582 
3583  exit(rc);
3584  }
3585  #endif
3586 }
3587 
3588 inline static m_fired* getInternalMessage_fired(void)
3589 {
3590  static m_fired *msg_prev = NULL;
3591  union pu_fired msg_pu;
3592  int rc;
3593 
3594  /* deallocate previously returned message */
3595  if (msg_prev != NULL)
3596  {
3597  free(msg_prev);
3598  }
3599  else
3600  {
3601  rc = MB_Iterator_Rewind(i_fired);
3602  #ifdef ERRCHECK
3603  if (rc != MB_SUCCESS)
3604  {
3605  fprintf(stderr, "ERROR: Could not rewind 'fired' Iterator\n");
3606  switch(rc) {
3607  case MB_ERR_INVALID:
3608  fprintf(stderr, "\t reason: 'fired' Iterator has not been created?\n");
3609  break;
3610  default:
3611  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3612  break;
3613  }
3614 
3615 
3616  exit(rc);
3617  }
3618  #endif
3619  }
3620 
3621  /* get next message from iterator */
3622  rc = MB_Iterator_GetMessage(i_fired, &(msg_pu.ptr_anon));
3623  #ifdef ERRCHECK
3624  if (rc != MB_SUCCESS)
3625  {
3626  fprintf(stderr, "ERROR: Could not get message from 'fired' Iterator\n");
3627  switch(rc) {
3628  case MB_ERR_INVALID:
3629  fprintf(stderr, "\t reason: 'fired' Iterator has not been created?\n");
3630  break;
3631  case MB_ERR_MEMALLOC:
3632  fprintf(stderr, "\t reason: out of memory\n");
3633  break;
3634  default:
3635  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3636  break;
3637  }
3638 
3639 
3640  exit(rc);
3641  }
3642  #endif
3643 
3644  /* store pointer so memory can be deallocated later */
3645  msg_prev = msg_pu.ptr;
3646 
3647  return msg_pu.ptr;
3648 }
3649 
3655 {
3656  return getInternalMessage_fired();
3657 }
3658 
3665 {
3666  return getInternalMessage_fired();
3667 }
3668 
3669 
3670 /* Box filtering functions */
3671 
3672 
3673 
3674 
3676 {
3678  void *ptr_anon;
3679 };
3680 
3686 void add_vacancy_stage1_message(int employer_id, double wage)
3687 {
3688  int rc;
3689  m_vacancy_stage1 msg;
3690 
3691  msg.employer_id = employer_id;
3692  msg.wage = wage;
3693 
3694 
3695  rc = MB_AddMessage(b_vacancy_stage1, &msg);
3696  #ifdef ERRCHECK
3697  if (rc != MB_SUCCESS)
3698  {
3699  fprintf(stderr, "ERROR: Could not add message to 'vacancy_stage1' board\n");
3700  switch(rc) {
3701  case MB_ERR_INVALID:
3702  fprintf(stderr, "\t reason: 'vacancy_stage1' board has not been created?\n");
3703  break;
3704  case MB_ERR_MEMALLOC:
3705  fprintf(stderr, "\t reason: out of memory\n");
3706  break;
3707  case MB_ERR_LOCKED:
3708  fprintf(stderr, "\t reason: 'vacancy_stage1' board is locked\n");
3709  break;
3710  case MB_ERR_INTERNAL:
3711  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3712  break;
3713  default:
3714  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3715  break;
3716  }
3717 
3718 
3719  exit(rc);
3720  }
3721  #endif
3722 }
3723 
3724 inline static m_vacancy_stage1* getInternalMessage_vacancy_stage1(void)
3725 {
3726  static m_vacancy_stage1 *msg_prev = NULL;
3727  union pu_vacancy_stage1 msg_pu;
3728  int rc;
3729 
3730  /* deallocate previously returned message */
3731  if (msg_prev != NULL)
3732  {
3733  free(msg_prev);
3734  }
3735  else
3736  {
3737  rc = MB_Iterator_Rewind(i_vacancy_stage1);
3738  #ifdef ERRCHECK
3739  if (rc != MB_SUCCESS)
3740  {
3741  fprintf(stderr, "ERROR: Could not rewind 'vacancy_stage1' Iterator\n");
3742  switch(rc) {
3743  case MB_ERR_INVALID:
3744  fprintf(stderr, "\t reason: 'vacancy_stage1' Iterator has not been created?\n");
3745  break;
3746  default:
3747  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3748  break;
3749  }
3750 
3751 
3752  exit(rc);
3753  }
3754  #endif
3755  }
3756 
3757  /* get next message from iterator */
3758  rc = MB_Iterator_GetMessage(i_vacancy_stage1, &(msg_pu.ptr_anon));
3759  #ifdef ERRCHECK
3760  if (rc != MB_SUCCESS)
3761  {
3762  fprintf(stderr, "ERROR: Could not get message from 'vacancy_stage1' Iterator\n");
3763  switch(rc) {
3764  case MB_ERR_INVALID:
3765  fprintf(stderr, "\t reason: 'vacancy_stage1' Iterator has not been created?\n");
3766  break;
3767  case MB_ERR_MEMALLOC:
3768  fprintf(stderr, "\t reason: out of memory\n");
3769  break;
3770  default:
3771  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3772  break;
3773  }
3774 
3775 
3776  exit(rc);
3777  }
3778  #endif
3779 
3780  /* store pointer so memory can be deallocated later */
3781  msg_prev = msg_pu.ptr;
3782 
3783  return msg_pu.ptr;
3784 }
3785 
3791 {
3792  return getInternalMessage_vacancy_stage1();
3793 }
3794 
3801 {
3802  return getInternalMessage_vacancy_stage1();
3803 }
3804 
3805 
3806 /* Box filtering functions */
3807 
3808 
3809 
3810 
3812 {
3814  void *ptr_anon;
3815 };
3816 
3822 {
3823  int rc;
3825 
3826  msg.employee_id = employee_id;
3827 
3828 
3829  rc = MB_AddMessage(b_job_application_stage2, &msg);
3830  #ifdef ERRCHECK
3831  if (rc != MB_SUCCESS)
3832  {
3833  fprintf(stderr, "ERROR: Could not add message to 'job_application_stage2' board\n");
3834  switch(rc) {
3835  case MB_ERR_INVALID:
3836  fprintf(stderr, "\t reason: 'job_application_stage2' board has not been created?\n");
3837  break;
3838  case MB_ERR_MEMALLOC:
3839  fprintf(stderr, "\t reason: out of memory\n");
3840  break;
3841  case MB_ERR_LOCKED:
3842  fprintf(stderr, "\t reason: 'job_application_stage2' board is locked\n");
3843  break;
3844  case MB_ERR_INTERNAL:
3845  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3846  break;
3847  default:
3848  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3849  break;
3850  }
3851 
3852 
3853  exit(rc);
3854  }
3855  #endif
3856 }
3857 
3858 inline static m_job_application_stage2* getInternalMessage_job_application_stage2(void)
3859 {
3860  static m_job_application_stage2 *msg_prev = NULL;
3861  union pu_job_application_stage2 msg_pu;
3862  int rc;
3863 
3864  /* deallocate previously returned message */
3865  if (msg_prev != NULL)
3866  {
3867  free(msg_prev);
3868  }
3869  else
3870  {
3871  rc = MB_Iterator_Rewind(i_job_application_stage2);
3872  #ifdef ERRCHECK
3873  if (rc != MB_SUCCESS)
3874  {
3875  fprintf(stderr, "ERROR: Could not rewind 'job_application_stage2' Iterator\n");
3876  switch(rc) {
3877  case MB_ERR_INVALID:
3878  fprintf(stderr, "\t reason: 'job_application_stage2' Iterator has not been created?\n");
3879  break;
3880  default:
3881  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
3882  break;
3883  }
3884 
3885 
3886  exit(rc);
3887  }
3888  #endif
3889  }
3890 
3891  /* get next message from iterator */
3892  rc = MB_Iterator_GetMessage(i_job_application_stage2, &(msg_pu.ptr_anon));
3893  #ifdef ERRCHECK
3894  if (rc != MB_SUCCESS)
3895  {
3896  fprintf(stderr, "ERROR: Could not get message from 'job_application_stage2' Iterator\n");
3897  switch(rc) {
3898  case MB_ERR_INVALID:
3899  fprintf(stderr, "\t reason: 'job_application_stage2' Iterator has not been created?\n");
3900  break;
3901  case MB_ERR_MEMALLOC:
3902  fprintf(stderr, "\t reason: out of memory\n");
3903  break;
3904  default:
3905  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
3906  break;
3907  }
3908 
3909 
3910  exit(rc);
3911  }
3912  #endif
3913 
3914  /* store pointer so memory can be deallocated later */
3915  msg_prev = msg_pu.ptr;
3916 
3917  return msg_pu.ptr;
3918 }
3919 
3925 {
3926  return getInternalMessage_job_application_stage2();
3927 }
3928 
3935 {
3936  return getInternalMessage_job_application_stage2();
3937 }
3938 
3939 
3940 /* Box filtering functions */
3941 
3942 
3943 
3944 
3946 {
3948  void *ptr_anon;
3949 };
3950 
3956 void add_job_application_stage1_message(int employee_id, double wage)
3957 {
3958  int rc;
3960 
3961  msg.employee_id = employee_id;
3962  msg.wage = wage;
3963 
3964 
3965  rc = MB_AddMessage(b_job_application_stage1, &msg);
3966  #ifdef ERRCHECK
3967  if (rc != MB_SUCCESS)
3968  {
3969  fprintf(stderr, "ERROR: Could not add message to 'job_application_stage1' board\n");
3970  switch(rc) {
3971  case MB_ERR_INVALID:
3972  fprintf(stderr, "\t reason: 'job_application_stage1' board has not been created?\n");
3973  break;
3974  case MB_ERR_MEMALLOC:
3975  fprintf(stderr, "\t reason: out of memory\n");
3976  break;
3977  case MB_ERR_LOCKED:
3978  fprintf(stderr, "\t reason: 'job_application_stage1' board is locked\n");
3979  break;
3980  case MB_ERR_INTERNAL:
3981  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
3982  break;
3983  default:
3984  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
3985  break;
3986  }
3987 
3988 
3989  exit(rc);
3990  }
3991  #endif
3992 }
3993 
3994 inline static m_job_application_stage1* getInternalMessage_job_application_stage1(void)
3995 {
3996  static m_job_application_stage1 *msg_prev = NULL;
3997  union pu_job_application_stage1 msg_pu;
3998  int rc;
3999 
4000  /* deallocate previously returned message */
4001  if (msg_prev != NULL)
4002  {
4003  free(msg_prev);
4004  }
4005  else
4006  {
4007  rc = MB_Iterator_Rewind(i_job_application_stage1);
4008  #ifdef ERRCHECK
4009  if (rc != MB_SUCCESS)
4010  {
4011  fprintf(stderr, "ERROR: Could not rewind 'job_application_stage1' Iterator\n");
4012  switch(rc) {
4013  case MB_ERR_INVALID:
4014  fprintf(stderr, "\t reason: 'job_application_stage1' Iterator has not been created?\n");
4015  break;
4016  default:
4017  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4018  break;
4019  }
4020 
4021 
4022  exit(rc);
4023  }
4024  #endif
4025  }
4026 
4027  /* get next message from iterator */
4028  rc = MB_Iterator_GetMessage(i_job_application_stage1, &(msg_pu.ptr_anon));
4029  #ifdef ERRCHECK
4030  if (rc != MB_SUCCESS)
4031  {
4032  fprintf(stderr, "ERROR: Could not get message from 'job_application_stage1' Iterator\n");
4033  switch(rc) {
4034  case MB_ERR_INVALID:
4035  fprintf(stderr, "\t reason: 'job_application_stage1' Iterator has not been created?\n");
4036  break;
4037  case MB_ERR_MEMALLOC:
4038  fprintf(stderr, "\t reason: out of memory\n");
4039  break;
4040  default:
4041  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4042  break;
4043  }
4044 
4045 
4046  exit(rc);
4047  }
4048  #endif
4049 
4050  /* store pointer so memory can be deallocated later */
4051  msg_prev = msg_pu.ptr;
4052 
4053  return msg_pu.ptr;
4054 }
4055 
4061 {
4062  return getInternalMessage_job_application_stage1();
4063 }
4064 
4071 {
4072  return getInternalMessage_job_application_stage1();
4073 }
4074 
4075 
4076 /* Box filtering functions */
4077 
4078 
4079 
4080 
4082 {
4084  void *ptr_anon;
4085 };
4086 
4093 void add_job_match_stage1_message(int employer_id, int employee_id, double wage)
4094 {
4095  int rc;
4096  m_job_match_stage1 msg;
4097 
4098  msg.employer_id = employer_id;
4099  msg.employee_id = employee_id;
4100  msg.wage = wage;
4101 
4102 
4103  rc = MB_AddMessage(b_job_match_stage1, &msg);
4104  #ifdef ERRCHECK
4105  if (rc != MB_SUCCESS)
4106  {
4107  fprintf(stderr, "ERROR: Could not add message to 'job_match_stage1' board\n");
4108  switch(rc) {
4109  case MB_ERR_INVALID:
4110  fprintf(stderr, "\t reason: 'job_match_stage1' board has not been created?\n");
4111  break;
4112  case MB_ERR_MEMALLOC:
4113  fprintf(stderr, "\t reason: out of memory\n");
4114  break;
4115  case MB_ERR_LOCKED:
4116  fprintf(stderr, "\t reason: 'job_match_stage1' board is locked\n");
4117  break;
4118  case MB_ERR_INTERNAL:
4119  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4120  break;
4121  default:
4122  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4123  break;
4124  }
4125 
4126 
4127  exit(rc);
4128  }
4129  #endif
4130 }
4131 
4132 inline static m_job_match_stage1* getInternalMessage_job_match_stage1(void)
4133 {
4134  static m_job_match_stage1 *msg_prev = NULL;
4135  union pu_job_match_stage1 msg_pu;
4136  int rc;
4137 
4138  /* deallocate previously returned message */
4139  if (msg_prev != NULL)
4140  {
4141  free(msg_prev);
4142  }
4143  else
4144  {
4145  rc = MB_Iterator_Rewind(i_job_match_stage1);
4146  #ifdef ERRCHECK
4147  if (rc != MB_SUCCESS)
4148  {
4149  fprintf(stderr, "ERROR: Could not rewind 'job_match_stage1' Iterator\n");
4150  switch(rc) {
4151  case MB_ERR_INVALID:
4152  fprintf(stderr, "\t reason: 'job_match_stage1' Iterator has not been created?\n");
4153  break;
4154  default:
4155  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4156  break;
4157  }
4158 
4159 
4160  exit(rc);
4161  }
4162  #endif
4163  }
4164 
4165  /* get next message from iterator */
4166  rc = MB_Iterator_GetMessage(i_job_match_stage1, &(msg_pu.ptr_anon));
4167  #ifdef ERRCHECK
4168  if (rc != MB_SUCCESS)
4169  {
4170  fprintf(stderr, "ERROR: Could not get message from 'job_match_stage1' Iterator\n");
4171  switch(rc) {
4172  case MB_ERR_INVALID:
4173  fprintf(stderr, "\t reason: 'job_match_stage1' Iterator has not been created?\n");
4174  break;
4175  case MB_ERR_MEMALLOC:
4176  fprintf(stderr, "\t reason: out of memory\n");
4177  break;
4178  default:
4179  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4180  break;
4181  }
4182 
4183 
4184  exit(rc);
4185  }
4186  #endif
4187 
4188  /* store pointer so memory can be deallocated later */
4189  msg_prev = msg_pu.ptr;
4190 
4191  return msg_pu.ptr;
4192 }
4193 
4199 {
4200  return getInternalMessage_job_match_stage1();
4201 }
4202 
4209 {
4210  return getInternalMessage_job_match_stage1();
4211 }
4212 
4213 
4214 /* Box filtering functions */
4215 
4216 
4217 
4218 
4220 {
4222  void *ptr_anon;
4223 };
4224 
4230 void add_job_change_message(int employer_id, int employee_id)
4231 {
4232  int rc;
4233  m_job_change msg;
4234 
4235  msg.employer_id = employer_id;
4236  msg.employee_id = employee_id;
4237 
4238 
4239  rc = MB_AddMessage(b_job_change, &msg);
4240  #ifdef ERRCHECK
4241  if (rc != MB_SUCCESS)
4242  {
4243  fprintf(stderr, "ERROR: Could not add message to 'job_change' board\n");
4244  switch(rc) {
4245  case MB_ERR_INVALID:
4246  fprintf(stderr, "\t reason: 'job_change' board has not been created?\n");
4247  break;
4248  case MB_ERR_MEMALLOC:
4249  fprintf(stderr, "\t reason: out of memory\n");
4250  break;
4251  case MB_ERR_LOCKED:
4252  fprintf(stderr, "\t reason: 'job_change' board is locked\n");
4253  break;
4254  case MB_ERR_INTERNAL:
4255  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4256  break;
4257  default:
4258  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4259  break;
4260  }
4261 
4262 
4263  exit(rc);
4264  }
4265  #endif
4266 }
4267 
4268 inline static m_job_change* getInternalMessage_job_change(void)
4269 {
4270  static m_job_change *msg_prev = NULL;
4271  union pu_job_change msg_pu;
4272  int rc;
4273 
4274  /* deallocate previously returned message */
4275  if (msg_prev != NULL)
4276  {
4277  free(msg_prev);
4278  }
4279  else
4280  {
4281  rc = MB_Iterator_Rewind(i_job_change);
4282  #ifdef ERRCHECK
4283  if (rc != MB_SUCCESS)
4284  {
4285  fprintf(stderr, "ERROR: Could not rewind 'job_change' Iterator\n");
4286  switch(rc) {
4287  case MB_ERR_INVALID:
4288  fprintf(stderr, "\t reason: 'job_change' Iterator has not been created?\n");
4289  break;
4290  default:
4291  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4292  break;
4293  }
4294 
4295 
4296  exit(rc);
4297  }
4298  #endif
4299  }
4300 
4301  /* get next message from iterator */
4302  rc = MB_Iterator_GetMessage(i_job_change, &(msg_pu.ptr_anon));
4303  #ifdef ERRCHECK
4304  if (rc != MB_SUCCESS)
4305  {
4306  fprintf(stderr, "ERROR: Could not get message from 'job_change' Iterator\n");
4307  switch(rc) {
4308  case MB_ERR_INVALID:
4309  fprintf(stderr, "\t reason: 'job_change' Iterator has not been created?\n");
4310  break;
4311  case MB_ERR_MEMALLOC:
4312  fprintf(stderr, "\t reason: out of memory\n");
4313  break;
4314  default:
4315  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4316  break;
4317  }
4318 
4319 
4320  exit(rc);
4321  }
4322  #endif
4323 
4324  /* store pointer so memory can be deallocated later */
4325  msg_prev = msg_pu.ptr;
4326 
4327  return msg_pu.ptr;
4328 }
4329 
4335 {
4336  return getInternalMessage_job_change();
4337 }
4338 
4345 {
4346  return getInternalMessage_job_change();
4347 }
4348 
4349 
4350 /* Box filtering functions */
4351 
4352 
4353 
4354 
4356 {
4358  void *ptr_anon;
4359 };
4360 
4366 void add_vacancy_stage2_message(int employer_id, double wage)
4367 {
4368  int rc;
4369  m_vacancy_stage2 msg;
4370 
4371  msg.employer_id = employer_id;
4372  msg.wage = wage;
4373 
4374 
4375  rc = MB_AddMessage(b_vacancy_stage2, &msg);
4376  #ifdef ERRCHECK
4377  if (rc != MB_SUCCESS)
4378  {
4379  fprintf(stderr, "ERROR: Could not add message to 'vacancy_stage2' board\n");
4380  switch(rc) {
4381  case MB_ERR_INVALID:
4382  fprintf(stderr, "\t reason: 'vacancy_stage2' board has not been created?\n");
4383  break;
4384  case MB_ERR_MEMALLOC:
4385  fprintf(stderr, "\t reason: out of memory\n");
4386  break;
4387  case MB_ERR_LOCKED:
4388  fprintf(stderr, "\t reason: 'vacancy_stage2' board is locked\n");
4389  break;
4390  case MB_ERR_INTERNAL:
4391  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4392  break;
4393  default:
4394  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4395  break;
4396  }
4397 
4398 
4399  exit(rc);
4400  }
4401  #endif
4402 }
4403 
4404 inline static m_vacancy_stage2* getInternalMessage_vacancy_stage2(void)
4405 {
4406  static m_vacancy_stage2 *msg_prev = NULL;
4407  union pu_vacancy_stage2 msg_pu;
4408  int rc;
4409 
4410  /* deallocate previously returned message */
4411  if (msg_prev != NULL)
4412  {
4413  free(msg_prev);
4414  }
4415  else
4416  {
4417  rc = MB_Iterator_Rewind(i_vacancy_stage2);
4418  #ifdef ERRCHECK
4419  if (rc != MB_SUCCESS)
4420  {
4421  fprintf(stderr, "ERROR: Could not rewind 'vacancy_stage2' Iterator\n");
4422  switch(rc) {
4423  case MB_ERR_INVALID:
4424  fprintf(stderr, "\t reason: 'vacancy_stage2' Iterator has not been created?\n");
4425  break;
4426  default:
4427  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4428  break;
4429  }
4430 
4431 
4432  exit(rc);
4433  }
4434  #endif
4435  }
4436 
4437  /* get next message from iterator */
4438  rc = MB_Iterator_GetMessage(i_vacancy_stage2, &(msg_pu.ptr_anon));
4439  #ifdef ERRCHECK
4440  if (rc != MB_SUCCESS)
4441  {
4442  fprintf(stderr, "ERROR: Could not get message from 'vacancy_stage2' Iterator\n");
4443  switch(rc) {
4444  case MB_ERR_INVALID:
4445  fprintf(stderr, "\t reason: 'vacancy_stage2' Iterator has not been created?\n");
4446  break;
4447  case MB_ERR_MEMALLOC:
4448  fprintf(stderr, "\t reason: out of memory\n");
4449  break;
4450  default:
4451  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4452  break;
4453  }
4454 
4455 
4456  exit(rc);
4457  }
4458  #endif
4459 
4460  /* store pointer so memory can be deallocated later */
4461  msg_prev = msg_pu.ptr;
4462 
4463  return msg_pu.ptr;
4464 }
4465 
4471 {
4472  return getInternalMessage_vacancy_stage2();
4473 }
4474 
4481 {
4482  return getInternalMessage_vacancy_stage2();
4483 }
4484 
4485 
4486 /* Box filtering functions */
4487 
4488 
4489 
4490 
4492 {
4494  void *ptr_anon;
4495 };
4496 
4503 void add_job_match_stage2_message(int employer_id, int employee_id, double wage)
4504 {
4505  int rc;
4506  m_job_match_stage2 msg;
4507 
4508  msg.employer_id = employer_id;
4509  msg.employee_id = employee_id;
4510  msg.wage = wage;
4511 
4512 
4513  rc = MB_AddMessage(b_job_match_stage2, &msg);
4514  #ifdef ERRCHECK
4515  if (rc != MB_SUCCESS)
4516  {
4517  fprintf(stderr, "ERROR: Could not add message to 'job_match_stage2' board\n");
4518  switch(rc) {
4519  case MB_ERR_INVALID:
4520  fprintf(stderr, "\t reason: 'job_match_stage2' board has not been created?\n");
4521  break;
4522  case MB_ERR_MEMALLOC:
4523  fprintf(stderr, "\t reason: out of memory\n");
4524  break;
4525  case MB_ERR_LOCKED:
4526  fprintf(stderr, "\t reason: 'job_match_stage2' board is locked\n");
4527  break;
4528  case MB_ERR_INTERNAL:
4529  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4530  break;
4531  default:
4532  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4533  break;
4534  }
4535 
4536 
4537  exit(rc);
4538  }
4539  #endif
4540 }
4541 
4542 inline static m_job_match_stage2* getInternalMessage_job_match_stage2(void)
4543 {
4544  static m_job_match_stage2 *msg_prev = NULL;
4545  union pu_job_match_stage2 msg_pu;
4546  int rc;
4547 
4548  /* deallocate previously returned message */
4549  if (msg_prev != NULL)
4550  {
4551  free(msg_prev);
4552  }
4553  else
4554  {
4555  rc = MB_Iterator_Rewind(i_job_match_stage2);
4556  #ifdef ERRCHECK
4557  if (rc != MB_SUCCESS)
4558  {
4559  fprintf(stderr, "ERROR: Could not rewind 'job_match_stage2' Iterator\n");
4560  switch(rc) {
4561  case MB_ERR_INVALID:
4562  fprintf(stderr, "\t reason: 'job_match_stage2' Iterator has not been created?\n");
4563  break;
4564  default:
4565  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4566  break;
4567  }
4568 
4569 
4570  exit(rc);
4571  }
4572  #endif
4573  }
4574 
4575  /* get next message from iterator */
4576  rc = MB_Iterator_GetMessage(i_job_match_stage2, &(msg_pu.ptr_anon));
4577  #ifdef ERRCHECK
4578  if (rc != MB_SUCCESS)
4579  {
4580  fprintf(stderr, "ERROR: Could not get message from 'job_match_stage2' Iterator\n");
4581  switch(rc) {
4582  case MB_ERR_INVALID:
4583  fprintf(stderr, "\t reason: 'job_match_stage2' Iterator has not been created?\n");
4584  break;
4585  case MB_ERR_MEMALLOC:
4586  fprintf(stderr, "\t reason: out of memory\n");
4587  break;
4588  default:
4589  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4590  break;
4591  }
4592 
4593 
4594  exit(rc);
4595  }
4596  #endif
4597 
4598  /* store pointer so memory can be deallocated later */
4599  msg_prev = msg_pu.ptr;
4600 
4601  return msg_pu.ptr;
4602 }
4603 
4609 {
4610  return getInternalMessage_job_match_stage2();
4611 }
4612 
4619 {
4620  return getInternalMessage_job_match_stage2();
4621 }
4622 
4623 
4624 /* Box filtering functions */
4625 
4626 
4627 
4628 
4630 {
4632  void *ptr_anon;
4633 };
4634 
4641 void add_employment_status_message(int employer_id, double wage, int nshares)
4642 {
4643  int rc;
4644  m_employment_status msg;
4645 
4646  msg.employer_id = employer_id;
4647  msg.wage = wage;
4648  msg.nshares = nshares;
4649 
4650 
4651  rc = MB_AddMessage(b_employment_status, &msg);
4652  #ifdef ERRCHECK
4653  if (rc != MB_SUCCESS)
4654  {
4655  fprintf(stderr, "ERROR: Could not add message to 'employment_status' board\n");
4656  switch(rc) {
4657  case MB_ERR_INVALID:
4658  fprintf(stderr, "\t reason: 'employment_status' board has not been created?\n");
4659  break;
4660  case MB_ERR_MEMALLOC:
4661  fprintf(stderr, "\t reason: out of memory\n");
4662  break;
4663  case MB_ERR_LOCKED:
4664  fprintf(stderr, "\t reason: 'employment_status' board is locked\n");
4665  break;
4666  case MB_ERR_INTERNAL:
4667  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4668  break;
4669  default:
4670  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4671  break;
4672  }
4673 
4674 
4675  exit(rc);
4676  }
4677  #endif
4678 }
4679 
4680 inline static m_employment_status* getInternalMessage_employment_status(void)
4681 {
4682  static m_employment_status *msg_prev = NULL;
4683  union pu_employment_status msg_pu;
4684  int rc;
4685 
4686  /* deallocate previously returned message */
4687  if (msg_prev != NULL)
4688  {
4689  free(msg_prev);
4690  }
4691  else
4692  {
4693  rc = MB_Iterator_Rewind(i_employment_status);
4694  #ifdef ERRCHECK
4695  if (rc != MB_SUCCESS)
4696  {
4697  fprintf(stderr, "ERROR: Could not rewind 'employment_status' Iterator\n");
4698  switch(rc) {
4699  case MB_ERR_INVALID:
4700  fprintf(stderr, "\t reason: 'employment_status' Iterator has not been created?\n");
4701  break;
4702  default:
4703  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4704  break;
4705  }
4706 
4707 
4708  exit(rc);
4709  }
4710  #endif
4711  }
4712 
4713  /* get next message from iterator */
4714  rc = MB_Iterator_GetMessage(i_employment_status, &(msg_pu.ptr_anon));
4715  #ifdef ERRCHECK
4716  if (rc != MB_SUCCESS)
4717  {
4718  fprintf(stderr, "ERROR: Could not get message from 'employment_status' Iterator\n");
4719  switch(rc) {
4720  case MB_ERR_INVALID:
4721  fprintf(stderr, "\t reason: 'employment_status' Iterator has not been created?\n");
4722  break;
4723  case MB_ERR_MEMALLOC:
4724  fprintf(stderr, "\t reason: out of memory\n");
4725  break;
4726  default:
4727  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4728  break;
4729  }
4730 
4731 
4732  exit(rc);
4733  }
4734  #endif
4735 
4736  /* store pointer so memory can be deallocated later */
4737  msg_prev = msg_pu.ptr;
4738 
4739  return msg_pu.ptr;
4740 }
4741 
4747 {
4748  return getInternalMessage_employment_status();
4749 }
4750 
4757 {
4758  return getInternalMessage_employment_status();
4759 }
4760 
4761 
4762 /* Box filtering functions */
4763 
4764 
4765 
4766 
4768 {
4770  void *ptr_anon;
4771 };
4772 
4778 void add_firm_household_wage_payment_message(int firm_id, double wage)
4779 {
4780  int rc;
4782 
4783  msg.firm_id = firm_id;
4784  msg.wage = wage;
4785 
4786 
4787  rc = MB_AddMessage(b_firm_household_wage_payment, &msg);
4788  #ifdef ERRCHECK
4789  if (rc != MB_SUCCESS)
4790  {
4791  fprintf(stderr, "ERROR: Could not add message to 'firm_household_wage_payment' board\n");
4792  switch(rc) {
4793  case MB_ERR_INVALID:
4794  fprintf(stderr, "\t reason: 'firm_household_wage_payment' board has not been created?\n");
4795  break;
4796  case MB_ERR_MEMALLOC:
4797  fprintf(stderr, "\t reason: out of memory\n");
4798  break;
4799  case MB_ERR_LOCKED:
4800  fprintf(stderr, "\t reason: 'firm_household_wage_payment' board is locked\n");
4801  break;
4802  case MB_ERR_INTERNAL:
4803  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4804  break;
4805  default:
4806  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4807  break;
4808  }
4809 
4810 
4811  exit(rc);
4812  }
4813  #endif
4814 }
4815 
4816 inline static m_firm_household_wage_payment* getInternalMessage_firm_household_wage_payment(void)
4817 {
4818  static m_firm_household_wage_payment *msg_prev = NULL;
4819  union pu_firm_household_wage_payment msg_pu;
4820  int rc;
4821 
4822  /* deallocate previously returned message */
4823  if (msg_prev != NULL)
4824  {
4825  free(msg_prev);
4826  }
4827  else
4828  {
4829  rc = MB_Iterator_Rewind(i_firm_household_wage_payment);
4830  #ifdef ERRCHECK
4831  if (rc != MB_SUCCESS)
4832  {
4833  fprintf(stderr, "ERROR: Could not rewind 'firm_household_wage_payment' Iterator\n");
4834  switch(rc) {
4835  case MB_ERR_INVALID:
4836  fprintf(stderr, "\t reason: 'firm_household_wage_payment' Iterator has not been created?\n");
4837  break;
4838  default:
4839  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4840  break;
4841  }
4842 
4843 
4844  exit(rc);
4845  }
4846  #endif
4847  }
4848 
4849  /* get next message from iterator */
4850  rc = MB_Iterator_GetMessage(i_firm_household_wage_payment, &(msg_pu.ptr_anon));
4851  #ifdef ERRCHECK
4852  if (rc != MB_SUCCESS)
4853  {
4854  fprintf(stderr, "ERROR: Could not get message from 'firm_household_wage_payment' Iterator\n");
4855  switch(rc) {
4856  case MB_ERR_INVALID:
4857  fprintf(stderr, "\t reason: 'firm_household_wage_payment' Iterator has not been created?\n");
4858  break;
4859  case MB_ERR_MEMALLOC:
4860  fprintf(stderr, "\t reason: out of memory\n");
4861  break;
4862  default:
4863  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
4864  break;
4865  }
4866 
4867 
4868  exit(rc);
4869  }
4870  #endif
4871 
4872  /* store pointer so memory can be deallocated later */
4873  msg_prev = msg_pu.ptr;
4874 
4875  return msg_pu.ptr;
4876 }
4877 
4883 {
4884  return getInternalMessage_firm_household_wage_payment();
4885 }
4886 
4893 {
4894  return getInternalMessage_firm_household_wage_payment();
4895 }
4896 
4897 
4898 /* Box filtering functions */
4899 
4900 
4901 
4902 
4904 {
4906  void *ptr_anon;
4907 };
4908 
4915 void add_firm_bank_loan_request_1_message(int firm_id, int bank_id, double amount)
4916 {
4917  int rc;
4919 
4920  msg.firm_id = firm_id;
4921  msg.bank_id = bank_id;
4922  msg.amount = amount;
4923 
4924 
4925  rc = MB_AddMessage(b_firm_bank_loan_request_1, &msg);
4926  #ifdef ERRCHECK
4927  if (rc != MB_SUCCESS)
4928  {
4929  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_loan_request_1' board\n");
4930  switch(rc) {
4931  case MB_ERR_INVALID:
4932  fprintf(stderr, "\t reason: 'firm_bank_loan_request_1' board has not been created?\n");
4933  break;
4934  case MB_ERR_MEMALLOC:
4935  fprintf(stderr, "\t reason: out of memory\n");
4936  break;
4937  case MB_ERR_LOCKED:
4938  fprintf(stderr, "\t reason: 'firm_bank_loan_request_1' board is locked\n");
4939  break;
4940  case MB_ERR_INTERNAL:
4941  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
4942  break;
4943  default:
4944  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
4945  break;
4946  }
4947 
4948 
4949  exit(rc);
4950  }
4951  #endif
4952 }
4953 
4954 inline static m_firm_bank_loan_request_1* getInternalMessage_firm_bank_loan_request_1(void)
4955 {
4956  static m_firm_bank_loan_request_1 *msg_prev = NULL;
4957  union pu_firm_bank_loan_request_1 msg_pu;
4958  int rc;
4959 
4960  /* deallocate previously returned message */
4961  if (msg_prev != NULL)
4962  {
4963  free(msg_prev);
4964  }
4965  else
4966  {
4967  rc = MB_Iterator_Rewind(i_firm_bank_loan_request_1);
4968  #ifdef ERRCHECK
4969  if (rc != MB_SUCCESS)
4970  {
4971  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_loan_request_1' Iterator\n");
4972  switch(rc) {
4973  case MB_ERR_INVALID:
4974  fprintf(stderr, "\t reason: 'firm_bank_loan_request_1' Iterator has not been created?\n");
4975  break;
4976  default:
4977  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
4978  break;
4979  }
4980 
4981 
4982  exit(rc);
4983  }
4984  #endif
4985  }
4986 
4987  /* get next message from iterator */
4988  rc = MB_Iterator_GetMessage(i_firm_bank_loan_request_1, &(msg_pu.ptr_anon));
4989  #ifdef ERRCHECK
4990  if (rc != MB_SUCCESS)
4991  {
4992  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_loan_request_1' Iterator\n");
4993  switch(rc) {
4994  case MB_ERR_INVALID:
4995  fprintf(stderr, "\t reason: 'firm_bank_loan_request_1' Iterator has not been created?\n");
4996  break;
4997  case MB_ERR_MEMALLOC:
4998  fprintf(stderr, "\t reason: out of memory\n");
4999  break;
5000  default:
5001  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5002  break;
5003  }
5004 
5005 
5006  exit(rc);
5007  }
5008  #endif
5009 
5010  /* store pointer so memory can be deallocated later */
5011  msg_prev = msg_pu.ptr;
5012 
5013  return msg_pu.ptr;
5014 }
5015 
5021 {
5022  return getInternalMessage_firm_bank_loan_request_1();
5023 }
5024 
5031 {
5032  return getInternalMessage_firm_bank_loan_request_1();
5033 }
5034 
5035 
5036 /* Box filtering functions */
5037 
5038 
5039 
5040 
5042 {
5044  void *ptr_anon;
5045 };
5046 
5053 void add_firm_bank_loan_request_2_message(int firm_id, int bank_id, double amount)
5054 {
5055  int rc;
5057 
5058  msg.firm_id = firm_id;
5059  msg.bank_id = bank_id;
5060  msg.amount = amount;
5061 
5062 
5063  rc = MB_AddMessage(b_firm_bank_loan_request_2, &msg);
5064  #ifdef ERRCHECK
5065  if (rc != MB_SUCCESS)
5066  {
5067  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_loan_request_2' board\n");
5068  switch(rc) {
5069  case MB_ERR_INVALID:
5070  fprintf(stderr, "\t reason: 'firm_bank_loan_request_2' board has not been created?\n");
5071  break;
5072  case MB_ERR_MEMALLOC:
5073  fprintf(stderr, "\t reason: out of memory\n");
5074  break;
5075  case MB_ERR_LOCKED:
5076  fprintf(stderr, "\t reason: 'firm_bank_loan_request_2' board is locked\n");
5077  break;
5078  case MB_ERR_INTERNAL:
5079  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5080  break;
5081  default:
5082  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5083  break;
5084  }
5085 
5086 
5087  exit(rc);
5088  }
5089  #endif
5090 }
5091 
5092 inline static m_firm_bank_loan_request_2* getInternalMessage_firm_bank_loan_request_2(void)
5093 {
5094  static m_firm_bank_loan_request_2 *msg_prev = NULL;
5095  union pu_firm_bank_loan_request_2 msg_pu;
5096  int rc;
5097 
5098  /* deallocate previously returned message */
5099  if (msg_prev != NULL)
5100  {
5101  free(msg_prev);
5102  }
5103  else
5104  {
5105  rc = MB_Iterator_Rewind(i_firm_bank_loan_request_2);
5106  #ifdef ERRCHECK
5107  if (rc != MB_SUCCESS)
5108  {
5109  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_loan_request_2' Iterator\n");
5110  switch(rc) {
5111  case MB_ERR_INVALID:
5112  fprintf(stderr, "\t reason: 'firm_bank_loan_request_2' Iterator has not been created?\n");
5113  break;
5114  default:
5115  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5116  break;
5117  }
5118 
5119 
5120  exit(rc);
5121  }
5122  #endif
5123  }
5124 
5125  /* get next message from iterator */
5126  rc = MB_Iterator_GetMessage(i_firm_bank_loan_request_2, &(msg_pu.ptr_anon));
5127  #ifdef ERRCHECK
5128  if (rc != MB_SUCCESS)
5129  {
5130  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_loan_request_2' Iterator\n");
5131  switch(rc) {
5132  case MB_ERR_INVALID:
5133  fprintf(stderr, "\t reason: 'firm_bank_loan_request_2' Iterator has not been created?\n");
5134  break;
5135  case MB_ERR_MEMALLOC:
5136  fprintf(stderr, "\t reason: out of memory\n");
5137  break;
5138  default:
5139  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5140  break;
5141  }
5142 
5143 
5144  exit(rc);
5145  }
5146  #endif
5147 
5148  /* store pointer so memory can be deallocated later */
5149  msg_prev = msg_pu.ptr;
5150 
5151  return msg_pu.ptr;
5152 }
5153 
5159 {
5160  return getInternalMessage_firm_bank_loan_request_2();
5161 }
5162 
5169 {
5170  return getInternalMessage_firm_bank_loan_request_2();
5171 }
5172 
5173 
5174 /* Box filtering functions */
5175 
5176 
5177 
5178 
5180 {
5182  void *ptr_anon;
5183 };
5184 
5191 void add_bank_firm_loan_acknowledge_1_message(int bank_id, int firm_id, double amount)
5192 {
5193  int rc;
5195 
5196  msg.bank_id = bank_id;
5197  msg.firm_id = firm_id;
5198  msg.amount = amount;
5199 
5200 
5201  rc = MB_AddMessage(b_bank_firm_loan_acknowledge_1, &msg);
5202  #ifdef ERRCHECK
5203  if (rc != MB_SUCCESS)
5204  {
5205  fprintf(stderr, "ERROR: Could not add message to 'bank_firm_loan_acknowledge_1' board\n");
5206  switch(rc) {
5207  case MB_ERR_INVALID:
5208  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_1' board has not been created?\n");
5209  break;
5210  case MB_ERR_MEMALLOC:
5211  fprintf(stderr, "\t reason: out of memory\n");
5212  break;
5213  case MB_ERR_LOCKED:
5214  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_1' board is locked\n");
5215  break;
5216  case MB_ERR_INTERNAL:
5217  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5218  break;
5219  default:
5220  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5221  break;
5222  }
5223 
5224 
5225  exit(rc);
5226  }
5227  #endif
5228 }
5229 
5230 inline static m_bank_firm_loan_acknowledge_1* getInternalMessage_bank_firm_loan_acknowledge_1(void)
5231 {
5232  static m_bank_firm_loan_acknowledge_1 *msg_prev = NULL;
5233  union pu_bank_firm_loan_acknowledge_1 msg_pu;
5234  int rc;
5235 
5236  /* deallocate previously returned message */
5237  if (msg_prev != NULL)
5238  {
5239  free(msg_prev);
5240  }
5241  else
5242  {
5243  rc = MB_Iterator_Rewind(i_bank_firm_loan_acknowledge_1);
5244  #ifdef ERRCHECK
5245  if (rc != MB_SUCCESS)
5246  {
5247  fprintf(stderr, "ERROR: Could not rewind 'bank_firm_loan_acknowledge_1' Iterator\n");
5248  switch(rc) {
5249  case MB_ERR_INVALID:
5250  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_1' Iterator has not been created?\n");
5251  break;
5252  default:
5253  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5254  break;
5255  }
5256 
5257 
5258  exit(rc);
5259  }
5260  #endif
5261  }
5262 
5263  /* get next message from iterator */
5264  rc = MB_Iterator_GetMessage(i_bank_firm_loan_acknowledge_1, &(msg_pu.ptr_anon));
5265  #ifdef ERRCHECK
5266  if (rc != MB_SUCCESS)
5267  {
5268  fprintf(stderr, "ERROR: Could not get message from 'bank_firm_loan_acknowledge_1' Iterator\n");
5269  switch(rc) {
5270  case MB_ERR_INVALID:
5271  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_1' Iterator has not been created?\n");
5272  break;
5273  case MB_ERR_MEMALLOC:
5274  fprintf(stderr, "\t reason: out of memory\n");
5275  break;
5276  default:
5277  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5278  break;
5279  }
5280 
5281 
5282  exit(rc);
5283  }
5284  #endif
5285 
5286  /* store pointer so memory can be deallocated later */
5287  msg_prev = msg_pu.ptr;
5288 
5289  return msg_pu.ptr;
5290 }
5291 
5297 {
5298  return getInternalMessage_bank_firm_loan_acknowledge_1();
5299 }
5300 
5307 {
5308  return getInternalMessage_bank_firm_loan_acknowledge_1();
5309 }
5310 
5311 
5312 /* Box filtering functions */
5313 
5314 
5315 
5316 
5318 {
5320  void *ptr_anon;
5321 };
5322 
5329 void add_bank_firm_loan_acknowledge_2_message(int bank_id, int firm_id, double amount)
5330 {
5331  int rc;
5333 
5334  msg.bank_id = bank_id;
5335  msg.firm_id = firm_id;
5336  msg.amount = amount;
5337 
5338 
5339  rc = MB_AddMessage(b_bank_firm_loan_acknowledge_2, &msg);
5340  #ifdef ERRCHECK
5341  if (rc != MB_SUCCESS)
5342  {
5343  fprintf(stderr, "ERROR: Could not add message to 'bank_firm_loan_acknowledge_2' board\n");
5344  switch(rc) {
5345  case MB_ERR_INVALID:
5346  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_2' board has not been created?\n");
5347  break;
5348  case MB_ERR_MEMALLOC:
5349  fprintf(stderr, "\t reason: out of memory\n");
5350  break;
5351  case MB_ERR_LOCKED:
5352  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_2' board is locked\n");
5353  break;
5354  case MB_ERR_INTERNAL:
5355  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5356  break;
5357  default:
5358  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5359  break;
5360  }
5361 
5362 
5363  exit(rc);
5364  }
5365  #endif
5366 }
5367 
5368 inline static m_bank_firm_loan_acknowledge_2* getInternalMessage_bank_firm_loan_acknowledge_2(void)
5369 {
5370  static m_bank_firm_loan_acknowledge_2 *msg_prev = NULL;
5371  union pu_bank_firm_loan_acknowledge_2 msg_pu;
5372  int rc;
5373 
5374  /* deallocate previously returned message */
5375  if (msg_prev != NULL)
5376  {
5377  free(msg_prev);
5378  }
5379  else
5380  {
5381  rc = MB_Iterator_Rewind(i_bank_firm_loan_acknowledge_2);
5382  #ifdef ERRCHECK
5383  if (rc != MB_SUCCESS)
5384  {
5385  fprintf(stderr, "ERROR: Could not rewind 'bank_firm_loan_acknowledge_2' Iterator\n");
5386  switch(rc) {
5387  case MB_ERR_INVALID:
5388  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_2' Iterator has not been created?\n");
5389  break;
5390  default:
5391  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5392  break;
5393  }
5394 
5395 
5396  exit(rc);
5397  }
5398  #endif
5399  }
5400 
5401  /* get next message from iterator */
5402  rc = MB_Iterator_GetMessage(i_bank_firm_loan_acknowledge_2, &(msg_pu.ptr_anon));
5403  #ifdef ERRCHECK
5404  if (rc != MB_SUCCESS)
5405  {
5406  fprintf(stderr, "ERROR: Could not get message from 'bank_firm_loan_acknowledge_2' Iterator\n");
5407  switch(rc) {
5408  case MB_ERR_INVALID:
5409  fprintf(stderr, "\t reason: 'bank_firm_loan_acknowledge_2' Iterator has not been created?\n");
5410  break;
5411  case MB_ERR_MEMALLOC:
5412  fprintf(stderr, "\t reason: out of memory\n");
5413  break;
5414  default:
5415  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5416  break;
5417  }
5418 
5419 
5420  exit(rc);
5421  }
5422  #endif
5423 
5424  /* store pointer so memory can be deallocated later */
5425  msg_prev = msg_pu.ptr;
5426 
5427  return msg_pu.ptr;
5428 }
5429 
5435 {
5436  return getInternalMessage_bank_firm_loan_acknowledge_2();
5437 }
5438 
5445 {
5446  return getInternalMessage_bank_firm_loan_acknowledge_2();
5447 }
5448 
5449 
5450 /* Box filtering functions */
5451 
5452 
5453 
5454 
5456 {
5458  void *ptr_anon;
5459 };
5460 
5466 void add_bank_centralbank_debt_request_message(int bank_id, double amount)
5467 {
5468  int rc;
5470 
5471  msg.bank_id = bank_id;
5472  msg.amount = amount;
5473 
5474 
5475  rc = MB_AddMessage(b_bank_centralbank_debt_request, &msg);
5476  #ifdef ERRCHECK
5477  if (rc != MB_SUCCESS)
5478  {
5479  fprintf(stderr, "ERROR: Could not add message to 'bank_centralbank_debt_request' board\n");
5480  switch(rc) {
5481  case MB_ERR_INVALID:
5482  fprintf(stderr, "\t reason: 'bank_centralbank_debt_request' board has not been created?\n");
5483  break;
5484  case MB_ERR_MEMALLOC:
5485  fprintf(stderr, "\t reason: out of memory\n");
5486  break;
5487  case MB_ERR_LOCKED:
5488  fprintf(stderr, "\t reason: 'bank_centralbank_debt_request' board is locked\n");
5489  break;
5490  case MB_ERR_INTERNAL:
5491  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5492  break;
5493  default:
5494  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5495  break;
5496  }
5497 
5498 
5499  exit(rc);
5500  }
5501  #endif
5502 }
5503 
5504 inline static m_bank_centralbank_debt_request* getInternalMessage_bank_centralbank_debt_request(void)
5505 {
5506  static m_bank_centralbank_debt_request *msg_prev = NULL;
5507  union pu_bank_centralbank_debt_request msg_pu;
5508  int rc;
5509 
5510  /* deallocate previously returned message */
5511  if (msg_prev != NULL)
5512  {
5513  free(msg_prev);
5514  }
5515  else
5516  {
5517  rc = MB_Iterator_Rewind(i_bank_centralbank_debt_request);
5518  #ifdef ERRCHECK
5519  if (rc != MB_SUCCESS)
5520  {
5521  fprintf(stderr, "ERROR: Could not rewind 'bank_centralbank_debt_request' Iterator\n");
5522  switch(rc) {
5523  case MB_ERR_INVALID:
5524  fprintf(stderr, "\t reason: 'bank_centralbank_debt_request' Iterator has not been created?\n");
5525  break;
5526  default:
5527  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5528  break;
5529  }
5530 
5531 
5532  exit(rc);
5533  }
5534  #endif
5535  }
5536 
5537  /* get next message from iterator */
5538  rc = MB_Iterator_GetMessage(i_bank_centralbank_debt_request, &(msg_pu.ptr_anon));
5539  #ifdef ERRCHECK
5540  if (rc != MB_SUCCESS)
5541  {
5542  fprintf(stderr, "ERROR: Could not get message from 'bank_centralbank_debt_request' Iterator\n");
5543  switch(rc) {
5544  case MB_ERR_INVALID:
5545  fprintf(stderr, "\t reason: 'bank_centralbank_debt_request' Iterator has not been created?\n");
5546  break;
5547  case MB_ERR_MEMALLOC:
5548  fprintf(stderr, "\t reason: out of memory\n");
5549  break;
5550  default:
5551  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5552  break;
5553  }
5554 
5555 
5556  exit(rc);
5557  }
5558  #endif
5559 
5560  /* store pointer so memory can be deallocated later */
5561  msg_prev = msg_pu.ptr;
5562 
5563  return msg_pu.ptr;
5564 }
5565 
5571 {
5572  return getInternalMessage_bank_centralbank_debt_request();
5573 }
5574 
5581 {
5582  return getInternalMessage_bank_centralbank_debt_request();
5583 }
5584 
5585 
5586 /* Box filtering functions */
5587 
5588 
5589 
5590 
5592 {
5594  void *ptr_anon;
5595 };
5596 
5601 void add_household_share_message(double amount)
5602 {
5603  int rc;
5604  m_household_share msg;
5605 
5606  msg.amount = amount;
5607 
5608 
5609  rc = MB_AddMessage(b_household_share, &msg);
5610  #ifdef ERRCHECK
5611  if (rc != MB_SUCCESS)
5612  {
5613  fprintf(stderr, "ERROR: Could not add message to 'household_share' board\n");
5614  switch(rc) {
5615  case MB_ERR_INVALID:
5616  fprintf(stderr, "\t reason: 'household_share' board has not been created?\n");
5617  break;
5618  case MB_ERR_MEMALLOC:
5619  fprintf(stderr, "\t reason: out of memory\n");
5620  break;
5621  case MB_ERR_LOCKED:
5622  fprintf(stderr, "\t reason: 'household_share' board is locked\n");
5623  break;
5624  case MB_ERR_INTERNAL:
5625  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5626  break;
5627  default:
5628  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5629  break;
5630  }
5631 
5632 
5633  exit(rc);
5634  }
5635  #endif
5636 }
5637 
5638 inline static m_household_share* getInternalMessage_household_share(void)
5639 {
5640  static m_household_share *msg_prev = NULL;
5641  union pu_household_share msg_pu;
5642  int rc;
5643 
5644  /* deallocate previously returned message */
5645  if (msg_prev != NULL)
5646  {
5647  free(msg_prev);
5648  }
5649  else
5650  {
5651  rc = MB_Iterator_Rewind(i_household_share);
5652  #ifdef ERRCHECK
5653  if (rc != MB_SUCCESS)
5654  {
5655  fprintf(stderr, "ERROR: Could not rewind 'household_share' Iterator\n");
5656  switch(rc) {
5657  case MB_ERR_INVALID:
5658  fprintf(stderr, "\t reason: 'household_share' Iterator has not been created?\n");
5659  break;
5660  default:
5661  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5662  break;
5663  }
5664 
5665 
5666  exit(rc);
5667  }
5668  #endif
5669  }
5670 
5671  /* get next message from iterator */
5672  rc = MB_Iterator_GetMessage(i_household_share, &(msg_pu.ptr_anon));
5673  #ifdef ERRCHECK
5674  if (rc != MB_SUCCESS)
5675  {
5676  fprintf(stderr, "ERROR: Could not get message from 'household_share' Iterator\n");
5677  switch(rc) {
5678  case MB_ERR_INVALID:
5679  fprintf(stderr, "\t reason: 'household_share' Iterator has not been created?\n");
5680  break;
5681  case MB_ERR_MEMALLOC:
5682  fprintf(stderr, "\t reason: out of memory\n");
5683  break;
5684  default:
5685  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5686  break;
5687  }
5688 
5689 
5690  exit(rc);
5691  }
5692  #endif
5693 
5694  /* store pointer so memory can be deallocated later */
5695  msg_prev = msg_pu.ptr;
5696 
5697  return msg_pu.ptr;
5698 }
5699 
5705 {
5706  return getInternalMessage_household_share();
5707 }
5708 
5715 {
5716  return getInternalMessage_household_share();
5717 }
5718 
5719 
5720 /* Box filtering functions */
5721 
5722 
5723 
5724 
5726 {
5728  void *ptr_anon;
5729 };
5730 
5735 void add_capital_tax_message(double amount)
5736 {
5737  int rc;
5738  m_capital_tax msg;
5739 
5740  msg.amount = amount;
5741 
5742 
5743  rc = MB_AddMessage(b_capital_tax, &msg);
5744  #ifdef ERRCHECK
5745  if (rc != MB_SUCCESS)
5746  {
5747  fprintf(stderr, "ERROR: Could not add message to 'capital_tax' board\n");
5748  switch(rc) {
5749  case MB_ERR_INVALID:
5750  fprintf(stderr, "\t reason: 'capital_tax' board has not been created?\n");
5751  break;
5752  case MB_ERR_MEMALLOC:
5753  fprintf(stderr, "\t reason: out of memory\n");
5754  break;
5755  case MB_ERR_LOCKED:
5756  fprintf(stderr, "\t reason: 'capital_tax' board is locked\n");
5757  break;
5758  case MB_ERR_INTERNAL:
5759  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5760  break;
5761  default:
5762  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5763  break;
5764  }
5765 
5766 
5767  exit(rc);
5768  }
5769  #endif
5770 }
5771 
5772 inline static m_capital_tax* getInternalMessage_capital_tax(void)
5773 {
5774  static m_capital_tax *msg_prev = NULL;
5775  union pu_capital_tax msg_pu;
5776  int rc;
5777 
5778  /* deallocate previously returned message */
5779  if (msg_prev != NULL)
5780  {
5781  free(msg_prev);
5782  }
5783  else
5784  {
5785  rc = MB_Iterator_Rewind(i_capital_tax);
5786  #ifdef ERRCHECK
5787  if (rc != MB_SUCCESS)
5788  {
5789  fprintf(stderr, "ERROR: Could not rewind 'capital_tax' Iterator\n");
5790  switch(rc) {
5791  case MB_ERR_INVALID:
5792  fprintf(stderr, "\t reason: 'capital_tax' Iterator has not been created?\n");
5793  break;
5794  default:
5795  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5796  break;
5797  }
5798 
5799 
5800  exit(rc);
5801  }
5802  #endif
5803  }
5804 
5805  /* get next message from iterator */
5806  rc = MB_Iterator_GetMessage(i_capital_tax, &(msg_pu.ptr_anon));
5807  #ifdef ERRCHECK
5808  if (rc != MB_SUCCESS)
5809  {
5810  fprintf(stderr, "ERROR: Could not get message from 'capital_tax' Iterator\n");
5811  switch(rc) {
5812  case MB_ERR_INVALID:
5813  fprintf(stderr, "\t reason: 'capital_tax' Iterator has not been created?\n");
5814  break;
5815  case MB_ERR_MEMALLOC:
5816  fprintf(stderr, "\t reason: out of memory\n");
5817  break;
5818  default:
5819  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5820  break;
5821  }
5822 
5823 
5824  exit(rc);
5825  }
5826  #endif
5827 
5828  /* store pointer so memory can be deallocated later */
5829  msg_prev = msg_pu.ptr;
5830 
5831  return msg_pu.ptr;
5832 }
5833 
5839 {
5840  return getInternalMessage_capital_tax();
5841 }
5842 
5849 {
5850  return getInternalMessage_capital_tax();
5851 }
5852 
5853 
5854 /* Box filtering functions */
5855 
5856 
5857 
5858 
5860 {
5862  void *ptr_anon;
5863 };
5864 
5869 void add_labour_tax_message(double amount)
5870 {
5871  int rc;
5872  m_labour_tax msg;
5873 
5874  msg.amount = amount;
5875 
5876 
5877  rc = MB_AddMessage(b_labour_tax, &msg);
5878  #ifdef ERRCHECK
5879  if (rc != MB_SUCCESS)
5880  {
5881  fprintf(stderr, "ERROR: Could not add message to 'labour_tax' board\n");
5882  switch(rc) {
5883  case MB_ERR_INVALID:
5884  fprintf(stderr, "\t reason: 'labour_tax' board has not been created?\n");
5885  break;
5886  case MB_ERR_MEMALLOC:
5887  fprintf(stderr, "\t reason: out of memory\n");
5888  break;
5889  case MB_ERR_LOCKED:
5890  fprintf(stderr, "\t reason: 'labour_tax' board is locked\n");
5891  break;
5892  case MB_ERR_INTERNAL:
5893  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
5894  break;
5895  default:
5896  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
5897  break;
5898  }
5899 
5900 
5901  exit(rc);
5902  }
5903  #endif
5904 }
5905 
5906 inline static m_labour_tax* getInternalMessage_labour_tax(void)
5907 {
5908  static m_labour_tax *msg_prev = NULL;
5909  union pu_labour_tax msg_pu;
5910  int rc;
5911 
5912  /* deallocate previously returned message */
5913  if (msg_prev != NULL)
5914  {
5915  free(msg_prev);
5916  }
5917  else
5918  {
5919  rc = MB_Iterator_Rewind(i_labour_tax);
5920  #ifdef ERRCHECK
5921  if (rc != MB_SUCCESS)
5922  {
5923  fprintf(stderr, "ERROR: Could not rewind 'labour_tax' Iterator\n");
5924  switch(rc) {
5925  case MB_ERR_INVALID:
5926  fprintf(stderr, "\t reason: 'labour_tax' Iterator has not been created?\n");
5927  break;
5928  default:
5929  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
5930  break;
5931  }
5932 
5933 
5934  exit(rc);
5935  }
5936  #endif
5937  }
5938 
5939  /* get next message from iterator */
5940  rc = MB_Iterator_GetMessage(i_labour_tax, &(msg_pu.ptr_anon));
5941  #ifdef ERRCHECK
5942  if (rc != MB_SUCCESS)
5943  {
5944  fprintf(stderr, "ERROR: Could not get message from 'labour_tax' Iterator\n");
5945  switch(rc) {
5946  case MB_ERR_INVALID:
5947  fprintf(stderr, "\t reason: 'labour_tax' Iterator has not been created?\n");
5948  break;
5949  case MB_ERR_MEMALLOC:
5950  fprintf(stderr, "\t reason: out of memory\n");
5951  break;
5952  default:
5953  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
5954  break;
5955  }
5956 
5957 
5958  exit(rc);
5959  }
5960  #endif
5961 
5962  /* store pointer so memory can be deallocated later */
5963  msg_prev = msg_pu.ptr;
5964 
5965  return msg_pu.ptr;
5966 }
5967 
5973 {
5974  return getInternalMessage_labour_tax();
5975 }
5976 
5983 {
5984  return getInternalMessage_labour_tax();
5985 }
5986 
5987 
5988 /* Box filtering functions */
5989 
5990 
5991 
5992 
5994 {
5996  void *ptr_anon;
5997 };
5998 
6004 {
6005  int rc;
6007 
6008  msg.amount = amount;
6009 
6010 
6011  rc = MB_AddMessage(b_unemployment_benefit, &msg);
6012  #ifdef ERRCHECK
6013  if (rc != MB_SUCCESS)
6014  {
6015  fprintf(stderr, "ERROR: Could not add message to 'unemployment_benefit' board\n");
6016  switch(rc) {
6017  case MB_ERR_INVALID:
6018  fprintf(stderr, "\t reason: 'unemployment_benefit' board has not been created?\n");
6019  break;
6020  case MB_ERR_MEMALLOC:
6021  fprintf(stderr, "\t reason: out of memory\n");
6022  break;
6023  case MB_ERR_LOCKED:
6024  fprintf(stderr, "\t reason: 'unemployment_benefit' board is locked\n");
6025  break;
6026  case MB_ERR_INTERNAL:
6027  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6028  break;
6029  default:
6030  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6031  break;
6032  }
6033 
6034 
6035  exit(rc);
6036  }
6037  #endif
6038 }
6039 
6040 inline static m_unemployment_benefit* getInternalMessage_unemployment_benefit(void)
6041 {
6042  static m_unemployment_benefit *msg_prev = NULL;
6043  union pu_unemployment_benefit msg_pu;
6044  int rc;
6045 
6046  /* deallocate previously returned message */
6047  if (msg_prev != NULL)
6048  {
6049  free(msg_prev);
6050  }
6051  else
6052  {
6053  rc = MB_Iterator_Rewind(i_unemployment_benefit);
6054  #ifdef ERRCHECK
6055  if (rc != MB_SUCCESS)
6056  {
6057  fprintf(stderr, "ERROR: Could not rewind 'unemployment_benefit' Iterator\n");
6058  switch(rc) {
6059  case MB_ERR_INVALID:
6060  fprintf(stderr, "\t reason: 'unemployment_benefit' Iterator has not been created?\n");
6061  break;
6062  default:
6063  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6064  break;
6065  }
6066 
6067 
6068  exit(rc);
6069  }
6070  #endif
6071  }
6072 
6073  /* get next message from iterator */
6074  rc = MB_Iterator_GetMessage(i_unemployment_benefit, &(msg_pu.ptr_anon));
6075  #ifdef ERRCHECK
6076  if (rc != MB_SUCCESS)
6077  {
6078  fprintf(stderr, "ERROR: Could not get message from 'unemployment_benefit' Iterator\n");
6079  switch(rc) {
6080  case MB_ERR_INVALID:
6081  fprintf(stderr, "\t reason: 'unemployment_benefit' Iterator has not been created?\n");
6082  break;
6083  case MB_ERR_MEMALLOC:
6084  fprintf(stderr, "\t reason: out of memory\n");
6085  break;
6086  default:
6087  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6088  break;
6089  }
6090 
6091 
6092  exit(rc);
6093  }
6094  #endif
6095 
6096  /* store pointer so memory can be deallocated later */
6097  msg_prev = msg_pu.ptr;
6098 
6099  return msg_pu.ptr;
6100 }
6101 
6107 {
6108  return getInternalMessage_unemployment_benefit();
6109 }
6110 
6117 {
6118  return getInternalMessage_unemployment_benefit();
6119 }
6120 
6121 
6122 /* Box filtering functions */
6123 
6124 
6125 
6126 
6128 {
6130  void *ptr_anon;
6131 };
6132 
6137 void add_general_benefit_message(double amount)
6138 {
6139  int rc;
6140  m_general_benefit msg;
6141 
6142  msg.amount = amount;
6143 
6144 
6145  rc = MB_AddMessage(b_general_benefit, &msg);
6146  #ifdef ERRCHECK
6147  if (rc != MB_SUCCESS)
6148  {
6149  fprintf(stderr, "ERROR: Could not add message to 'general_benefit' board\n");
6150  switch(rc) {
6151  case MB_ERR_INVALID:
6152  fprintf(stderr, "\t reason: 'general_benefit' board has not been created?\n");
6153  break;
6154  case MB_ERR_MEMALLOC:
6155  fprintf(stderr, "\t reason: out of memory\n");
6156  break;
6157  case MB_ERR_LOCKED:
6158  fprintf(stderr, "\t reason: 'general_benefit' board is locked\n");
6159  break;
6160  case MB_ERR_INTERNAL:
6161  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6162  break;
6163  default:
6164  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6165  break;
6166  }
6167 
6168 
6169  exit(rc);
6170  }
6171  #endif
6172 }
6173 
6174 inline static m_general_benefit* getInternalMessage_general_benefit(void)
6175 {
6176  static m_general_benefit *msg_prev = NULL;
6177  union pu_general_benefit msg_pu;
6178  int rc;
6179 
6180  /* deallocate previously returned message */
6181  if (msg_prev != NULL)
6182  {
6183  free(msg_prev);
6184  }
6185  else
6186  {
6187  rc = MB_Iterator_Rewind(i_general_benefit);
6188  #ifdef ERRCHECK
6189  if (rc != MB_SUCCESS)
6190  {
6191  fprintf(stderr, "ERROR: Could not rewind 'general_benefit' Iterator\n");
6192  switch(rc) {
6193  case MB_ERR_INVALID:
6194  fprintf(stderr, "\t reason: 'general_benefit' Iterator has not been created?\n");
6195  break;
6196  default:
6197  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6198  break;
6199  }
6200 
6201 
6202  exit(rc);
6203  }
6204  #endif
6205  }
6206 
6207  /* get next message from iterator */
6208  rc = MB_Iterator_GetMessage(i_general_benefit, &(msg_pu.ptr_anon));
6209  #ifdef ERRCHECK
6210  if (rc != MB_SUCCESS)
6211  {
6212  fprintf(stderr, "ERROR: Could not get message from 'general_benefit' Iterator\n");
6213  switch(rc) {
6214  case MB_ERR_INVALID:
6215  fprintf(stderr, "\t reason: 'general_benefit' Iterator has not been created?\n");
6216  break;
6217  case MB_ERR_MEMALLOC:
6218  fprintf(stderr, "\t reason: out of memory\n");
6219  break;
6220  default:
6221  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6222  break;
6223  }
6224 
6225 
6226  exit(rc);
6227  }
6228  #endif
6229 
6230  /* store pointer so memory can be deallocated later */
6231  msg_prev = msg_pu.ptr;
6232 
6233  return msg_pu.ptr;
6234 }
6235 
6241 {
6242  return getInternalMessage_general_benefit();
6243 }
6244 
6251 {
6252  return getInternalMessage_general_benefit();
6253 }
6254 
6255 
6256 /* Box filtering functions */
6257 
6258 
6259 
6260 
6262 {
6264  void *ptr_anon;
6265 };
6266 
6272 void add_fund_request_message(int firm_id, double amount)
6273 {
6274  int rc;
6275  m_fund_request msg;
6276 
6277  msg.firm_id = firm_id;
6278  msg.amount = amount;
6279 
6280 
6281  rc = MB_AddMessage(b_fund_request, &msg);
6282  #ifdef ERRCHECK
6283  if (rc != MB_SUCCESS)
6284  {
6285  fprintf(stderr, "ERROR: Could not add message to 'fund_request' board\n");
6286  switch(rc) {
6287  case MB_ERR_INVALID:
6288  fprintf(stderr, "\t reason: 'fund_request' board has not been created?\n");
6289  break;
6290  case MB_ERR_MEMALLOC:
6291  fprintf(stderr, "\t reason: out of memory\n");
6292  break;
6293  case MB_ERR_LOCKED:
6294  fprintf(stderr, "\t reason: 'fund_request' board is locked\n");
6295  break;
6296  case MB_ERR_INTERNAL:
6297  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6298  break;
6299  default:
6300  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6301  break;
6302  }
6303 
6304 
6305  exit(rc);
6306  }
6307  #endif
6308 }
6309 
6310 inline static m_fund_request* getInternalMessage_fund_request(void)
6311 {
6312  static m_fund_request *msg_prev = NULL;
6313  union pu_fund_request msg_pu;
6314  int rc;
6315 
6316  /* deallocate previously returned message */
6317  if (msg_prev != NULL)
6318  {
6319  free(msg_prev);
6320  }
6321  else
6322  {
6323  rc = MB_Iterator_Rewind(i_fund_request);
6324  #ifdef ERRCHECK
6325  if (rc != MB_SUCCESS)
6326  {
6327  fprintf(stderr, "ERROR: Could not rewind 'fund_request' Iterator\n");
6328  switch(rc) {
6329  case MB_ERR_INVALID:
6330  fprintf(stderr, "\t reason: 'fund_request' Iterator has not been created?\n");
6331  break;
6332  default:
6333  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6334  break;
6335  }
6336 
6337 
6338  exit(rc);
6339  }
6340  #endif
6341  }
6342 
6343  /* get next message from iterator */
6344  rc = MB_Iterator_GetMessage(i_fund_request, &(msg_pu.ptr_anon));
6345  #ifdef ERRCHECK
6346  if (rc != MB_SUCCESS)
6347  {
6348  fprintf(stderr, "ERROR: Could not get message from 'fund_request' Iterator\n");
6349  switch(rc) {
6350  case MB_ERR_INVALID:
6351  fprintf(stderr, "\t reason: 'fund_request' Iterator has not been created?\n");
6352  break;
6353  case MB_ERR_MEMALLOC:
6354  fprintf(stderr, "\t reason: out of memory\n");
6355  break;
6356  default:
6357  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6358  break;
6359  }
6360 
6361 
6362  exit(rc);
6363  }
6364  #endif
6365 
6366  /* store pointer so memory can be deallocated later */
6367  msg_prev = msg_pu.ptr;
6368 
6369  return msg_pu.ptr;
6370 }
6371 
6377 {
6378  return getInternalMessage_fund_request();
6379 }
6380 
6387 {
6388  return getInternalMessage_fund_request();
6389 }
6390 
6391 
6392 /* Box filtering functions */
6393 
6394 
6395 
6396 
6398 {
6400  void *ptr_anon;
6401 };
6402 
6408 void add_fund_request_ack_message(int firm_id, double amount)
6409 {
6410  int rc;
6411  m_fund_request_ack msg;
6412 
6413  msg.firm_id = firm_id;
6414  msg.amount = amount;
6415 
6416 
6417  rc = MB_AddMessage(b_fund_request_ack, &msg);
6418  #ifdef ERRCHECK
6419  if (rc != MB_SUCCESS)
6420  {
6421  fprintf(stderr, "ERROR: Could not add message to 'fund_request_ack' board\n");
6422  switch(rc) {
6423  case MB_ERR_INVALID:
6424  fprintf(stderr, "\t reason: 'fund_request_ack' board has not been created?\n");
6425  break;
6426  case MB_ERR_MEMALLOC:
6427  fprintf(stderr, "\t reason: out of memory\n");
6428  break;
6429  case MB_ERR_LOCKED:
6430  fprintf(stderr, "\t reason: 'fund_request_ack' board is locked\n");
6431  break;
6432  case MB_ERR_INTERNAL:
6433  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6434  break;
6435  default:
6436  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6437  break;
6438  }
6439 
6440 
6441  exit(rc);
6442  }
6443  #endif
6444 }
6445 
6446 inline static m_fund_request_ack* getInternalMessage_fund_request_ack(void)
6447 {
6448  static m_fund_request_ack *msg_prev = NULL;
6449  union pu_fund_request_ack msg_pu;
6450  int rc;
6451 
6452  /* deallocate previously returned message */
6453  if (msg_prev != NULL)
6454  {
6455  free(msg_prev);
6456  }
6457  else
6458  {
6459  rc = MB_Iterator_Rewind(i_fund_request_ack);
6460  #ifdef ERRCHECK
6461  if (rc != MB_SUCCESS)
6462  {
6463  fprintf(stderr, "ERROR: Could not rewind 'fund_request_ack' Iterator\n");
6464  switch(rc) {
6465  case MB_ERR_INVALID:
6466  fprintf(stderr, "\t reason: 'fund_request_ack' Iterator has not been created?\n");
6467  break;
6468  default:
6469  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6470  break;
6471  }
6472 
6473 
6474  exit(rc);
6475  }
6476  #endif
6477  }
6478 
6479  /* get next message from iterator */
6480  rc = MB_Iterator_GetMessage(i_fund_request_ack, &(msg_pu.ptr_anon));
6481  #ifdef ERRCHECK
6482  if (rc != MB_SUCCESS)
6483  {
6484  fprintf(stderr, "ERROR: Could not get message from 'fund_request_ack' Iterator\n");
6485  switch(rc) {
6486  case MB_ERR_INVALID:
6487  fprintf(stderr, "\t reason: 'fund_request_ack' Iterator has not been created?\n");
6488  break;
6489  case MB_ERR_MEMALLOC:
6490  fprintf(stderr, "\t reason: out of memory\n");
6491  break;
6492  default:
6493  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6494  break;
6495  }
6496 
6497 
6498  exit(rc);
6499  }
6500  #endif
6501 
6502  /* store pointer so memory can be deallocated later */
6503  msg_prev = msg_pu.ptr;
6504 
6505  return msg_pu.ptr;
6506 }
6507 
6513 {
6514  return getInternalMessage_fund_request_ack();
6515 }
6516 
6523 {
6524  return getInternalMessage_fund_request_ack();
6525 }
6526 
6527 
6528 /* Box filtering functions */
6529 
6530 
6531 
6532 
6534 {
6536  void *ptr_anon;
6537 };
6538 
6545 void add_new_entrant_loan_message(int firm_id, int bank_id, double amount)
6546 {
6547  int rc;
6548  m_new_entrant_loan msg;
6549 
6550  msg.firm_id = firm_id;
6551  msg.bank_id = bank_id;
6552  msg.amount = amount;
6553 
6554 
6555  rc = MB_AddMessage(b_new_entrant_loan, &msg);
6556  #ifdef ERRCHECK
6557  if (rc != MB_SUCCESS)
6558  {
6559  fprintf(stderr, "ERROR: Could not add message to 'new_entrant_loan' board\n");
6560  switch(rc) {
6561  case MB_ERR_INVALID:
6562  fprintf(stderr, "\t reason: 'new_entrant_loan' board has not been created?\n");
6563  break;
6564  case MB_ERR_MEMALLOC:
6565  fprintf(stderr, "\t reason: out of memory\n");
6566  break;
6567  case MB_ERR_LOCKED:
6568  fprintf(stderr, "\t reason: 'new_entrant_loan' board is locked\n");
6569  break;
6570  case MB_ERR_INTERNAL:
6571  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6572  break;
6573  default:
6574  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6575  break;
6576  }
6577 
6578 
6579  exit(rc);
6580  }
6581  #endif
6582 }
6583 
6584 inline static m_new_entrant_loan* getInternalMessage_new_entrant_loan(void)
6585 {
6586  static m_new_entrant_loan *msg_prev = NULL;
6587  union pu_new_entrant_loan msg_pu;
6588  int rc;
6589 
6590  /* deallocate previously returned message */
6591  if (msg_prev != NULL)
6592  {
6593  free(msg_prev);
6594  }
6595  else
6596  {
6597  rc = MB_Iterator_Rewind(i_new_entrant_loan);
6598  #ifdef ERRCHECK
6599  if (rc != MB_SUCCESS)
6600  {
6601  fprintf(stderr, "ERROR: Could not rewind 'new_entrant_loan' Iterator\n");
6602  switch(rc) {
6603  case MB_ERR_INVALID:
6604  fprintf(stderr, "\t reason: 'new_entrant_loan' Iterator has not been created?\n");
6605  break;
6606  default:
6607  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6608  break;
6609  }
6610 
6611 
6612  exit(rc);
6613  }
6614  #endif
6615  }
6616 
6617  /* get next message from iterator */
6618  rc = MB_Iterator_GetMessage(i_new_entrant_loan, &(msg_pu.ptr_anon));
6619  #ifdef ERRCHECK
6620  if (rc != MB_SUCCESS)
6621  {
6622  fprintf(stderr, "ERROR: Could not get message from 'new_entrant_loan' Iterator\n");
6623  switch(rc) {
6624  case MB_ERR_INVALID:
6625  fprintf(stderr, "\t reason: 'new_entrant_loan' Iterator has not been created?\n");
6626  break;
6627  case MB_ERR_MEMALLOC:
6628  fprintf(stderr, "\t reason: out of memory\n");
6629  break;
6630  default:
6631  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6632  break;
6633  }
6634 
6635 
6636  exit(rc);
6637  }
6638  #endif
6639 
6640  /* store pointer so memory can be deallocated later */
6641  msg_prev = msg_pu.ptr;
6642 
6643  return msg_pu.ptr;
6644 }
6645 
6651 {
6652  return getInternalMessage_new_entrant_loan();
6653 }
6654 
6661 {
6662  return getInternalMessage_new_entrant_loan();
6663 }
6664 
6665 
6666 /* Box filtering functions */
6667 
6668 
6669 
6670 
6672 {
6674  void *ptr_anon;
6675 };
6676 
6682 void add_firm_bank_interest_on_loan_message(int bank_id, double amount)
6683 {
6684  int rc;
6686 
6687  msg.bank_id = bank_id;
6688  msg.amount = amount;
6689 
6690 
6691  rc = MB_AddMessage(b_firm_bank_interest_on_loan, &msg);
6692  #ifdef ERRCHECK
6693  if (rc != MB_SUCCESS)
6694  {
6695  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_interest_on_loan' board\n");
6696  switch(rc) {
6697  case MB_ERR_INVALID:
6698  fprintf(stderr, "\t reason: 'firm_bank_interest_on_loan' board has not been created?\n");
6699  break;
6700  case MB_ERR_MEMALLOC:
6701  fprintf(stderr, "\t reason: out of memory\n");
6702  break;
6703  case MB_ERR_LOCKED:
6704  fprintf(stderr, "\t reason: 'firm_bank_interest_on_loan' board is locked\n");
6705  break;
6706  case MB_ERR_INTERNAL:
6707  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6708  break;
6709  default:
6710  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6711  break;
6712  }
6713 
6714 
6715  exit(rc);
6716  }
6717  #endif
6718 }
6719 
6720 inline static m_firm_bank_interest_on_loan* getInternalMessage_firm_bank_interest_on_loan(void)
6721 {
6722  static m_firm_bank_interest_on_loan *msg_prev = NULL;
6723  union pu_firm_bank_interest_on_loan msg_pu;
6724  int rc;
6725 
6726  /* deallocate previously returned message */
6727  if (msg_prev != NULL)
6728  {
6729  free(msg_prev);
6730  }
6731  else
6732  {
6733  rc = MB_Iterator_Rewind(i_firm_bank_interest_on_loan);
6734  #ifdef ERRCHECK
6735  if (rc != MB_SUCCESS)
6736  {
6737  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_interest_on_loan' Iterator\n");
6738  switch(rc) {
6739  case MB_ERR_INVALID:
6740  fprintf(stderr, "\t reason: 'firm_bank_interest_on_loan' Iterator has not been created?\n");
6741  break;
6742  default:
6743  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6744  break;
6745  }
6746 
6747 
6748  exit(rc);
6749  }
6750  #endif
6751  }
6752 
6753  /* get next message from iterator */
6754  rc = MB_Iterator_GetMessage(i_firm_bank_interest_on_loan, &(msg_pu.ptr_anon));
6755  #ifdef ERRCHECK
6756  if (rc != MB_SUCCESS)
6757  {
6758  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_interest_on_loan' Iterator\n");
6759  switch(rc) {
6760  case MB_ERR_INVALID:
6761  fprintf(stderr, "\t reason: 'firm_bank_interest_on_loan' Iterator has not been created?\n");
6762  break;
6763  case MB_ERR_MEMALLOC:
6764  fprintf(stderr, "\t reason: out of memory\n");
6765  break;
6766  default:
6767  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6768  break;
6769  }
6770 
6771 
6772  exit(rc);
6773  }
6774  #endif
6775 
6776  /* store pointer so memory can be deallocated later */
6777  msg_prev = msg_pu.ptr;
6778 
6779  return msg_pu.ptr;
6780 }
6781 
6787 {
6788  return getInternalMessage_firm_bank_interest_on_loan();
6789 }
6790 
6797 {
6798  return getInternalMessage_firm_bank_interest_on_loan();
6799 }
6800 
6801 
6802 /* Box filtering functions */
6803 
6804 
6805 
6806 
6808 {
6810  void *ptr_anon;
6811 };
6812 
6818 void add_loan_writeoff_message(int bank_id, double amount)
6819 {
6820  int rc;
6821  m_loan_writeoff msg;
6822 
6823  msg.bank_id = bank_id;
6824  msg.amount = amount;
6825 
6826 
6827  rc = MB_AddMessage(b_loan_writeoff, &msg);
6828  #ifdef ERRCHECK
6829  if (rc != MB_SUCCESS)
6830  {
6831  fprintf(stderr, "ERROR: Could not add message to 'loan_writeoff' board\n");
6832  switch(rc) {
6833  case MB_ERR_INVALID:
6834  fprintf(stderr, "\t reason: 'loan_writeoff' board has not been created?\n");
6835  break;
6836  case MB_ERR_MEMALLOC:
6837  fprintf(stderr, "\t reason: out of memory\n");
6838  break;
6839  case MB_ERR_LOCKED:
6840  fprintf(stderr, "\t reason: 'loan_writeoff' board is locked\n");
6841  break;
6842  case MB_ERR_INTERNAL:
6843  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6844  break;
6845  default:
6846  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6847  break;
6848  }
6849 
6850 
6851  exit(rc);
6852  }
6853  #endif
6854 }
6855 
6856 inline static m_loan_writeoff* getInternalMessage_loan_writeoff(void)
6857 {
6858  static m_loan_writeoff *msg_prev = NULL;
6859  union pu_loan_writeoff msg_pu;
6860  int rc;
6861 
6862  /* deallocate previously returned message */
6863  if (msg_prev != NULL)
6864  {
6865  free(msg_prev);
6866  }
6867  else
6868  {
6869  rc = MB_Iterator_Rewind(i_loan_writeoff);
6870  #ifdef ERRCHECK
6871  if (rc != MB_SUCCESS)
6872  {
6873  fprintf(stderr, "ERROR: Could not rewind 'loan_writeoff' Iterator\n");
6874  switch(rc) {
6875  case MB_ERR_INVALID:
6876  fprintf(stderr, "\t reason: 'loan_writeoff' Iterator has not been created?\n");
6877  break;
6878  default:
6879  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
6880  break;
6881  }
6882 
6883 
6884  exit(rc);
6885  }
6886  #endif
6887  }
6888 
6889  /* get next message from iterator */
6890  rc = MB_Iterator_GetMessage(i_loan_writeoff, &(msg_pu.ptr_anon));
6891  #ifdef ERRCHECK
6892  if (rc != MB_SUCCESS)
6893  {
6894  fprintf(stderr, "ERROR: Could not get message from 'loan_writeoff' Iterator\n");
6895  switch(rc) {
6896  case MB_ERR_INVALID:
6897  fprintf(stderr, "\t reason: 'loan_writeoff' Iterator has not been created?\n");
6898  break;
6899  case MB_ERR_MEMALLOC:
6900  fprintf(stderr, "\t reason: out of memory\n");
6901  break;
6902  default:
6903  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
6904  break;
6905  }
6906 
6907 
6908  exit(rc);
6909  }
6910  #endif
6911 
6912  /* store pointer so memory can be deallocated later */
6913  msg_prev = msg_pu.ptr;
6914 
6915  return msg_pu.ptr;
6916 }
6917 
6923 {
6924  return getInternalMessage_loan_writeoff();
6925 }
6926 
6933 {
6934  return getInternalMessage_loan_writeoff();
6935 }
6936 
6937 
6938 /* Box filtering functions */
6939 
6940 
6941 
6942 
6944 {
6946  void *ptr_anon;
6947 };
6948 
6954 void add_firm_bank_insolvent_account_message(int bank_id, double liquidity)
6955 {
6956  int rc;
6958 
6959  msg.bank_id = bank_id;
6960  msg.liquidity = liquidity;
6961 
6962 
6963  rc = MB_AddMessage(b_firm_bank_insolvent_account, &msg);
6964  #ifdef ERRCHECK
6965  if (rc != MB_SUCCESS)
6966  {
6967  fprintf(stderr, "ERROR: Could not add message to 'firm_bank_insolvent_account' board\n");
6968  switch(rc) {
6969  case MB_ERR_INVALID:
6970  fprintf(stderr, "\t reason: 'firm_bank_insolvent_account' board has not been created?\n");
6971  break;
6972  case MB_ERR_MEMALLOC:
6973  fprintf(stderr, "\t reason: out of memory\n");
6974  break;
6975  case MB_ERR_LOCKED:
6976  fprintf(stderr, "\t reason: 'firm_bank_insolvent_account' board is locked\n");
6977  break;
6978  case MB_ERR_INTERNAL:
6979  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
6980  break;
6981  default:
6982  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
6983  break;
6984  }
6985 
6986 
6987  exit(rc);
6988  }
6989  #endif
6990 }
6991 
6992 inline static m_firm_bank_insolvent_account* getInternalMessage_firm_bank_insolvent_account(void)
6993 {
6994  static m_firm_bank_insolvent_account *msg_prev = NULL;
6995  union pu_firm_bank_insolvent_account msg_pu;
6996  int rc;
6997 
6998  /* deallocate previously returned message */
6999  if (msg_prev != NULL)
7000  {
7001  free(msg_prev);
7002  }
7003  else
7004  {
7005  rc = MB_Iterator_Rewind(i_firm_bank_insolvent_account);
7006  #ifdef ERRCHECK
7007  if (rc != MB_SUCCESS)
7008  {
7009  fprintf(stderr, "ERROR: Could not rewind 'firm_bank_insolvent_account' Iterator\n");
7010  switch(rc) {
7011  case MB_ERR_INVALID:
7012  fprintf(stderr, "\t reason: 'firm_bank_insolvent_account' Iterator has not been created?\n");
7013  break;
7014  default:
7015  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7016  break;
7017  }
7018 
7019 
7020  exit(rc);
7021  }
7022  #endif
7023  }
7024 
7025  /* get next message from iterator */
7026  rc = MB_Iterator_GetMessage(i_firm_bank_insolvent_account, &(msg_pu.ptr_anon));
7027  #ifdef ERRCHECK
7028  if (rc != MB_SUCCESS)
7029  {
7030  fprintf(stderr, "ERROR: Could not get message from 'firm_bank_insolvent_account' Iterator\n");
7031  switch(rc) {
7032  case MB_ERR_INVALID:
7033  fprintf(stderr, "\t reason: 'firm_bank_insolvent_account' Iterator has not been created?\n");
7034  break;
7035  case MB_ERR_MEMALLOC:
7036  fprintf(stderr, "\t reason: out of memory\n");
7037  break;
7038  default:
7039  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7040  break;
7041  }
7042 
7043 
7044  exit(rc);
7045  }
7046  #endif
7047 
7048  /* store pointer so memory can be deallocated later */
7049  msg_prev = msg_pu.ptr;
7050 
7051  return msg_pu.ptr;
7052 }
7053 
7059 {
7060  return getInternalMessage_firm_bank_insolvent_account();
7061 }
7062 
7069 {
7070  return getInternalMessage_firm_bank_insolvent_account();
7071 }
7072 
7073 
7074 /* Box filtering functions */
7075 
7076 
7077 
7078 
7080 {
7082  void *ptr_anon;
7083 };
7084 
7091 void add_firm_net_profit_message(int id, int isconstructor, double net_income)
7092 {
7093  int rc;
7094  m_firm_net_profit msg;
7095 
7096  msg.id = id;
7097  msg.isconstructor = isconstructor;
7098  msg.net_income = net_income;
7099 
7100 
7101  rc = MB_AddMessage(b_firm_net_profit, &msg);
7102  #ifdef ERRCHECK
7103  if (rc != MB_SUCCESS)
7104  {
7105  fprintf(stderr, "ERROR: Could not add message to 'firm_net_profit' board\n");
7106  switch(rc) {
7107  case MB_ERR_INVALID:
7108  fprintf(stderr, "\t reason: 'firm_net_profit' board has not been created?\n");
7109  break;
7110  case MB_ERR_MEMALLOC:
7111  fprintf(stderr, "\t reason: out of memory\n");
7112  break;
7113  case MB_ERR_LOCKED:
7114  fprintf(stderr, "\t reason: 'firm_net_profit' board is locked\n");
7115  break;
7116  case MB_ERR_INTERNAL:
7117  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7118  break;
7119  default:
7120  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7121  break;
7122  }
7123 
7124 
7125  exit(rc);
7126  }
7127  #endif
7128 }
7129 
7130 inline static m_firm_net_profit* getInternalMessage_firm_net_profit(void)
7131 {
7132  static m_firm_net_profit *msg_prev = NULL;
7133  union pu_firm_net_profit msg_pu;
7134  int rc;
7135 
7136  /* deallocate previously returned message */
7137  if (msg_prev != NULL)
7138  {
7139  free(msg_prev);
7140  }
7141  else
7142  {
7143  rc = MB_Iterator_Rewind(i_firm_net_profit);
7144  #ifdef ERRCHECK
7145  if (rc != MB_SUCCESS)
7146  {
7147  fprintf(stderr, "ERROR: Could not rewind 'firm_net_profit' Iterator\n");
7148  switch(rc) {
7149  case MB_ERR_INVALID:
7150  fprintf(stderr, "\t reason: 'firm_net_profit' Iterator has not been created?\n");
7151  break;
7152  default:
7153  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7154  break;
7155  }
7156 
7157 
7158  exit(rc);
7159  }
7160  #endif
7161  }
7162 
7163  /* get next message from iterator */
7164  rc = MB_Iterator_GetMessage(i_firm_net_profit, &(msg_pu.ptr_anon));
7165  #ifdef ERRCHECK
7166  if (rc != MB_SUCCESS)
7167  {
7168  fprintf(stderr, "ERROR: Could not get message from 'firm_net_profit' Iterator\n");
7169  switch(rc) {
7170  case MB_ERR_INVALID:
7171  fprintf(stderr, "\t reason: 'firm_net_profit' Iterator has not been created?\n");
7172  break;
7173  case MB_ERR_MEMALLOC:
7174  fprintf(stderr, "\t reason: out of memory\n");
7175  break;
7176  default:
7177  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7178  break;
7179  }
7180 
7181 
7182  exit(rc);
7183  }
7184  #endif
7185 
7186  /* store pointer so memory can be deallocated later */
7187  msg_prev = msg_pu.ptr;
7188 
7189  return msg_pu.ptr;
7190 }
7191 
7197 {
7198  return getInternalMessage_firm_net_profit();
7199 }
7200 
7207 {
7208  return getInternalMessage_firm_net_profit();
7209 }
7210 
7211 
7212 /* Box filtering functions */
7213 
7214 
7215 
7216 
7218 {
7220  void *ptr_anon;
7221 };
7222 
7228 void add_bank_net_profit_message(int id, double net_income)
7229 {
7230  int rc;
7231  m_bank_net_profit msg;
7232 
7233  msg.id = id;
7234  msg.net_income = net_income;
7235 
7236 
7237  rc = MB_AddMessage(b_bank_net_profit, &msg);
7238  #ifdef ERRCHECK
7239  if (rc != MB_SUCCESS)
7240  {
7241  fprintf(stderr, "ERROR: Could not add message to 'bank_net_profit' board\n");
7242  switch(rc) {
7243  case MB_ERR_INVALID:
7244  fprintf(stderr, "\t reason: 'bank_net_profit' board has not been created?\n");
7245  break;
7246  case MB_ERR_MEMALLOC:
7247  fprintf(stderr, "\t reason: out of memory\n");
7248  break;
7249  case MB_ERR_LOCKED:
7250  fprintf(stderr, "\t reason: 'bank_net_profit' board is locked\n");
7251  break;
7252  case MB_ERR_INTERNAL:
7253  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7254  break;
7255  default:
7256  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7257  break;
7258  }
7259 
7260 
7261  exit(rc);
7262  }
7263  #endif
7264 }
7265 
7266 inline static m_bank_net_profit* getInternalMessage_bank_net_profit(void)
7267 {
7268  static m_bank_net_profit *msg_prev = NULL;
7269  union pu_bank_net_profit msg_pu;
7270  int rc;
7271 
7272  /* deallocate previously returned message */
7273  if (msg_prev != NULL)
7274  {
7275  free(msg_prev);
7276  }
7277  else
7278  {
7279  rc = MB_Iterator_Rewind(i_bank_net_profit);
7280  #ifdef ERRCHECK
7281  if (rc != MB_SUCCESS)
7282  {
7283  fprintf(stderr, "ERROR: Could not rewind 'bank_net_profit' Iterator\n");
7284  switch(rc) {
7285  case MB_ERR_INVALID:
7286  fprintf(stderr, "\t reason: 'bank_net_profit' Iterator has not been created?\n");
7287  break;
7288  default:
7289  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7290  break;
7291  }
7292 
7293 
7294  exit(rc);
7295  }
7296  #endif
7297  }
7298 
7299  /* get next message from iterator */
7300  rc = MB_Iterator_GetMessage(i_bank_net_profit, &(msg_pu.ptr_anon));
7301  #ifdef ERRCHECK
7302  if (rc != MB_SUCCESS)
7303  {
7304  fprintf(stderr, "ERROR: Could not get message from 'bank_net_profit' Iterator\n");
7305  switch(rc) {
7306  case MB_ERR_INVALID:
7307  fprintf(stderr, "\t reason: 'bank_net_profit' Iterator has not been created?\n");
7308  break;
7309  case MB_ERR_MEMALLOC:
7310  fprintf(stderr, "\t reason: out of memory\n");
7311  break;
7312  default:
7313  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7314  break;
7315  }
7316 
7317 
7318  exit(rc);
7319  }
7320  #endif
7321 
7322  /* store pointer so memory can be deallocated later */
7323  msg_prev = msg_pu.ptr;
7324 
7325  return msg_pu.ptr;
7326 }
7327 
7333 {
7334  return getInternalMessage_bank_net_profit();
7335 }
7336 
7343 {
7344  return getInternalMessage_bank_net_profit();
7345 }
7346 
7347 
7348 /* Box filtering functions */
7349 
7350 
7351 
7352 
7354 {
7356  void *ptr_anon;
7357 };
7358 
7365 {
7366  int rc;
7368 
7369  msg.id = id;
7370  msg.amount = amount;
7371 
7372 
7373  rc = MB_AddMessage(b_bank_centralbank_interest_payment, &msg);
7374  #ifdef ERRCHECK
7375  if (rc != MB_SUCCESS)
7376  {
7377  fprintf(stderr, "ERROR: Could not add message to 'bank_centralbank_interest_payment' board\n");
7378  switch(rc) {
7379  case MB_ERR_INVALID:
7380  fprintf(stderr, "\t reason: 'bank_centralbank_interest_payment' board has not been created?\n");
7381  break;
7382  case MB_ERR_MEMALLOC:
7383  fprintf(stderr, "\t reason: out of memory\n");
7384  break;
7385  case MB_ERR_LOCKED:
7386  fprintf(stderr, "\t reason: 'bank_centralbank_interest_payment' board is locked\n");
7387  break;
7388  case MB_ERR_INTERNAL:
7389  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7390  break;
7391  default:
7392  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7393  break;
7394  }
7395 
7396 
7397  exit(rc);
7398  }
7399  #endif
7400 }
7401 
7402 inline static m_bank_centralbank_interest_payment* getInternalMessage_bank_centralbank_interest_payment(void)
7403 {
7404  static m_bank_centralbank_interest_payment *msg_prev = NULL;
7406  int rc;
7407 
7408  /* deallocate previously returned message */
7409  if (msg_prev != NULL)
7410  {
7411  free(msg_prev);
7412  }
7413  else
7414  {
7415  rc = MB_Iterator_Rewind(i_bank_centralbank_interest_payment);
7416  #ifdef ERRCHECK
7417  if (rc != MB_SUCCESS)
7418  {
7419  fprintf(stderr, "ERROR: Could not rewind 'bank_centralbank_interest_payment' Iterator\n");
7420  switch(rc) {
7421  case MB_ERR_INVALID:
7422  fprintf(stderr, "\t reason: 'bank_centralbank_interest_payment' Iterator has not been created?\n");
7423  break;
7424  default:
7425  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7426  break;
7427  }
7428 
7429 
7430  exit(rc);
7431  }
7432  #endif
7433  }
7434 
7435  /* get next message from iterator */
7436  rc = MB_Iterator_GetMessage(i_bank_centralbank_interest_payment, &(msg_pu.ptr_anon));
7437  #ifdef ERRCHECK
7438  if (rc != MB_SUCCESS)
7439  {
7440  fprintf(stderr, "ERROR: Could not get message from 'bank_centralbank_interest_payment' Iterator\n");
7441  switch(rc) {
7442  case MB_ERR_INVALID:
7443  fprintf(stderr, "\t reason: 'bank_centralbank_interest_payment' Iterator has not been created?\n");
7444  break;
7445  case MB_ERR_MEMALLOC:
7446  fprintf(stderr, "\t reason: out of memory\n");
7447  break;
7448  default:
7449  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7450  break;
7451  }
7452 
7453 
7454  exit(rc);
7455  }
7456  #endif
7457 
7458  /* store pointer so memory can be deallocated later */
7459  msg_prev = msg_pu.ptr;
7460 
7461  return msg_pu.ptr;
7462 }
7463 
7469 {
7470  return getInternalMessage_bank_centralbank_interest_payment();
7471 }
7472 
7479 {
7480  return getInternalMessage_bank_centralbank_interest_payment();
7481 }
7482 
7483 
7484 /* Box filtering functions */
7485 
7486 
7487 
7488 
7490 {
7492  void *ptr_anon;
7493 };
7494 
7501 {
7502  int rc;
7504 
7505  msg.id = id;
7506  msg.amount = amount;
7507 
7508 
7509  rc = MB_AddMessage(b_bank_centralbank_debt_payment, &msg);
7510  #ifdef ERRCHECK
7511  if (rc != MB_SUCCESS)
7512  {
7513  fprintf(stderr, "ERROR: Could not add message to 'bank_centralbank_debt_payment' board\n");
7514  switch(rc) {
7515  case MB_ERR_INVALID:
7516  fprintf(stderr, "\t reason: 'bank_centralbank_debt_payment' board has not been created?\n");
7517  break;
7518  case MB_ERR_MEMALLOC:
7519  fprintf(stderr, "\t reason: out of memory\n");
7520  break;
7521  case MB_ERR_LOCKED:
7522  fprintf(stderr, "\t reason: 'bank_centralbank_debt_payment' board is locked\n");
7523  break;
7524  case MB_ERR_INTERNAL:
7525  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7526  break;
7527  default:
7528  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7529  break;
7530  }
7531 
7532 
7533  exit(rc);
7534  }
7535  #endif
7536 }
7537 
7538 inline static m_bank_centralbank_debt_payment* getInternalMessage_bank_centralbank_debt_payment(void)
7539 {
7540  static m_bank_centralbank_debt_payment *msg_prev = NULL;
7541  union pu_bank_centralbank_debt_payment msg_pu;
7542  int rc;
7543 
7544  /* deallocate previously returned message */
7545  if (msg_prev != NULL)
7546  {
7547  free(msg_prev);
7548  }
7549  else
7550  {
7551  rc = MB_Iterator_Rewind(i_bank_centralbank_debt_payment);
7552  #ifdef ERRCHECK
7553  if (rc != MB_SUCCESS)
7554  {
7555  fprintf(stderr, "ERROR: Could not rewind 'bank_centralbank_debt_payment' Iterator\n");
7556  switch(rc) {
7557  case MB_ERR_INVALID:
7558  fprintf(stderr, "\t reason: 'bank_centralbank_debt_payment' Iterator has not been created?\n");
7559  break;
7560  default:
7561  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7562  break;
7563  }
7564 
7565 
7566  exit(rc);
7567  }
7568  #endif
7569  }
7570 
7571  /* get next message from iterator */
7572  rc = MB_Iterator_GetMessage(i_bank_centralbank_debt_payment, &(msg_pu.ptr_anon));
7573  #ifdef ERRCHECK
7574  if (rc != MB_SUCCESS)
7575  {
7576  fprintf(stderr, "ERROR: Could not get message from 'bank_centralbank_debt_payment' Iterator\n");
7577  switch(rc) {
7578  case MB_ERR_INVALID:
7579  fprintf(stderr, "\t reason: 'bank_centralbank_debt_payment' Iterator has not been created?\n");
7580  break;
7581  case MB_ERR_MEMALLOC:
7582  fprintf(stderr, "\t reason: out of memory\n");
7583  break;
7584  default:
7585  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7586  break;
7587  }
7588 
7589 
7590  exit(rc);
7591  }
7592  #endif
7593 
7594  /* store pointer so memory can be deallocated later */
7595  msg_prev = msg_pu.ptr;
7596 
7597  return msg_pu.ptr;
7598 }
7599 
7605 {
7606  return getInternalMessage_bank_centralbank_debt_payment();
7607 }
7608 
7615 {
7616  return getInternalMessage_bank_centralbank_debt_payment();
7617 }
7618 
7619 
7620 /* Box filtering functions */
7621 
7622 
7623 
7624 
7626 {
7628  void *ptr_anon;
7629 };
7630 
7636 {
7637  int rc;
7639 
7640  msg.amount = amount;
7641 
7642 
7643  rc = MB_AddMessage(b_gov_centralbank_debt_request, &msg);
7644  #ifdef ERRCHECK
7645  if (rc != MB_SUCCESS)
7646  {
7647  fprintf(stderr, "ERROR: Could not add message to 'gov_centralbank_debt_request' board\n");
7648  switch(rc) {
7649  case MB_ERR_INVALID:
7650  fprintf(stderr, "\t reason: 'gov_centralbank_debt_request' board has not been created?\n");
7651  break;
7652  case MB_ERR_MEMALLOC:
7653  fprintf(stderr, "\t reason: out of memory\n");
7654  break;
7655  case MB_ERR_LOCKED:
7656  fprintf(stderr, "\t reason: 'gov_centralbank_debt_request' board is locked\n");
7657  break;
7658  case MB_ERR_INTERNAL:
7659  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7660  break;
7661  default:
7662  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7663  break;
7664  }
7665 
7666 
7667  exit(rc);
7668  }
7669  #endif
7670 }
7671 
7672 inline static m_gov_centralbank_debt_request* getInternalMessage_gov_centralbank_debt_request(void)
7673 {
7674  static m_gov_centralbank_debt_request *msg_prev = NULL;
7675  union pu_gov_centralbank_debt_request msg_pu;
7676  int rc;
7677 
7678  /* deallocate previously returned message */
7679  if (msg_prev != NULL)
7680  {
7681  free(msg_prev);
7682  }
7683  else
7684  {
7685  rc = MB_Iterator_Rewind(i_gov_centralbank_debt_request);
7686  #ifdef ERRCHECK
7687  if (rc != MB_SUCCESS)
7688  {
7689  fprintf(stderr, "ERROR: Could not rewind 'gov_centralbank_debt_request' Iterator\n");
7690  switch(rc) {
7691  case MB_ERR_INVALID:
7692  fprintf(stderr, "\t reason: 'gov_centralbank_debt_request' Iterator has not been created?\n");
7693  break;
7694  default:
7695  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7696  break;
7697  }
7698 
7699 
7700  exit(rc);
7701  }
7702  #endif
7703  }
7704 
7705  /* get next message from iterator */
7706  rc = MB_Iterator_GetMessage(i_gov_centralbank_debt_request, &(msg_pu.ptr_anon));
7707  #ifdef ERRCHECK
7708  if (rc != MB_SUCCESS)
7709  {
7710  fprintf(stderr, "ERROR: Could not get message from 'gov_centralbank_debt_request' Iterator\n");
7711  switch(rc) {
7712  case MB_ERR_INVALID:
7713  fprintf(stderr, "\t reason: 'gov_centralbank_debt_request' Iterator has not been created?\n");
7714  break;
7715  case MB_ERR_MEMALLOC:
7716  fprintf(stderr, "\t reason: out of memory\n");
7717  break;
7718  default:
7719  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7720  break;
7721  }
7722 
7723 
7724  exit(rc);
7725  }
7726  #endif
7727 
7728  /* store pointer so memory can be deallocated later */
7729  msg_prev = msg_pu.ptr;
7730 
7731  return msg_pu.ptr;
7732 }
7733 
7739 {
7740  return getInternalMessage_gov_centralbank_debt_request();
7741 }
7742 
7749 {
7750  return getInternalMessage_gov_centralbank_debt_request();
7751 }
7752 
7753 
7754 /* Box filtering functions */
7755 
7756 
7757 
7758 
7760 {
7762  void *ptr_anon;
7763 };
7764 
7770 {
7771  int rc;
7773 
7774  msg.amount = amount;
7775 
7776 
7777  rc = MB_AddMessage(b_gov_centralbank_debt_payment, &msg);
7778  #ifdef ERRCHECK
7779  if (rc != MB_SUCCESS)
7780  {
7781  fprintf(stderr, "ERROR: Could not add message to 'gov_centralbank_debt_payment' board\n");
7782  switch(rc) {
7783  case MB_ERR_INVALID:
7784  fprintf(stderr, "\t reason: 'gov_centralbank_debt_payment' board has not been created?\n");
7785  break;
7786  case MB_ERR_MEMALLOC:
7787  fprintf(stderr, "\t reason: out of memory\n");
7788  break;
7789  case MB_ERR_LOCKED:
7790  fprintf(stderr, "\t reason: 'gov_centralbank_debt_payment' board is locked\n");
7791  break;
7792  case MB_ERR_INTERNAL:
7793  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7794  break;
7795  default:
7796  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7797  break;
7798  }
7799 
7800 
7801  exit(rc);
7802  }
7803  #endif
7804 }
7805 
7806 inline static m_gov_centralbank_debt_payment* getInternalMessage_gov_centralbank_debt_payment(void)
7807 {
7808  static m_gov_centralbank_debt_payment *msg_prev = NULL;
7809  union pu_gov_centralbank_debt_payment msg_pu;
7810  int rc;
7811 
7812  /* deallocate previously returned message */
7813  if (msg_prev != NULL)
7814  {
7815  free(msg_prev);
7816  }
7817  else
7818  {
7819  rc = MB_Iterator_Rewind(i_gov_centralbank_debt_payment);
7820  #ifdef ERRCHECK
7821  if (rc != MB_SUCCESS)
7822  {
7823  fprintf(stderr, "ERROR: Could not rewind 'gov_centralbank_debt_payment' Iterator\n");
7824  switch(rc) {
7825  case MB_ERR_INVALID:
7826  fprintf(stderr, "\t reason: 'gov_centralbank_debt_payment' Iterator has not been created?\n");
7827  break;
7828  default:
7829  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7830  break;
7831  }
7832 
7833 
7834  exit(rc);
7835  }
7836  #endif
7837  }
7838 
7839  /* get next message from iterator */
7840  rc = MB_Iterator_GetMessage(i_gov_centralbank_debt_payment, &(msg_pu.ptr_anon));
7841  #ifdef ERRCHECK
7842  if (rc != MB_SUCCESS)
7843  {
7844  fprintf(stderr, "ERROR: Could not get message from 'gov_centralbank_debt_payment' Iterator\n");
7845  switch(rc) {
7846  case MB_ERR_INVALID:
7847  fprintf(stderr, "\t reason: 'gov_centralbank_debt_payment' Iterator has not been created?\n");
7848  break;
7849  case MB_ERR_MEMALLOC:
7850  fprintf(stderr, "\t reason: out of memory\n");
7851  break;
7852  default:
7853  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7854  break;
7855  }
7856 
7857 
7858  exit(rc);
7859  }
7860  #endif
7861 
7862  /* store pointer so memory can be deallocated later */
7863  msg_prev = msg_pu.ptr;
7864 
7865  return msg_pu.ptr;
7866 }
7867 
7873 {
7874  return getInternalMessage_gov_centralbank_debt_payment();
7875 }
7876 
7883 {
7884  return getInternalMessage_gov_centralbank_debt_payment();
7885 }
7886 
7887 
7888 /* Box filtering functions */
7889 
7890 
7891 
7892 
7894 {
7896  void *ptr_anon;
7897 };
7898 
7904 {
7905  int rc;
7907 
7908  msg.amount = amount;
7909 
7910 
7911  rc = MB_AddMessage(b_centralbank_government_profit, &msg);
7912  #ifdef ERRCHECK
7913  if (rc != MB_SUCCESS)
7914  {
7915  fprintf(stderr, "ERROR: Could not add message to 'centralbank_government_profit' board\n");
7916  switch(rc) {
7917  case MB_ERR_INVALID:
7918  fprintf(stderr, "\t reason: 'centralbank_government_profit' board has not been created?\n");
7919  break;
7920  case MB_ERR_MEMALLOC:
7921  fprintf(stderr, "\t reason: out of memory\n");
7922  break;
7923  case MB_ERR_LOCKED:
7924  fprintf(stderr, "\t reason: 'centralbank_government_profit' board is locked\n");
7925  break;
7926  case MB_ERR_INTERNAL:
7927  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
7928  break;
7929  default:
7930  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
7931  break;
7932  }
7933 
7934 
7935  exit(rc);
7936  }
7937  #endif
7938 }
7939 
7940 inline static m_centralbank_government_profit* getInternalMessage_centralbank_government_profit(void)
7941 {
7942  static m_centralbank_government_profit *msg_prev = NULL;
7943  union pu_centralbank_government_profit msg_pu;
7944  int rc;
7945 
7946  /* deallocate previously returned message */
7947  if (msg_prev != NULL)
7948  {
7949  free(msg_prev);
7950  }
7951  else
7952  {
7953  rc = MB_Iterator_Rewind(i_centralbank_government_profit);
7954  #ifdef ERRCHECK
7955  if (rc != MB_SUCCESS)
7956  {
7957  fprintf(stderr, "ERROR: Could not rewind 'centralbank_government_profit' Iterator\n");
7958  switch(rc) {
7959  case MB_ERR_INVALID:
7960  fprintf(stderr, "\t reason: 'centralbank_government_profit' Iterator has not been created?\n");
7961  break;
7962  default:
7963  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
7964  break;
7965  }
7966 
7967 
7968  exit(rc);
7969  }
7970  #endif
7971  }
7972 
7973  /* get next message from iterator */
7974  rc = MB_Iterator_GetMessage(i_centralbank_government_profit, &(msg_pu.ptr_anon));
7975  #ifdef ERRCHECK
7976  if (rc != MB_SUCCESS)
7977  {
7978  fprintf(stderr, "ERROR: Could not get message from 'centralbank_government_profit' Iterator\n");
7979  switch(rc) {
7980  case MB_ERR_INVALID:
7981  fprintf(stderr, "\t reason: 'centralbank_government_profit' Iterator has not been created?\n");
7982  break;
7983  case MB_ERR_MEMALLOC:
7984  fprintf(stderr, "\t reason: out of memory\n");
7985  break;
7986  default:
7987  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
7988  break;
7989  }
7990 
7991 
7992  exit(rc);
7993  }
7994  #endif
7995 
7996  /* store pointer so memory can be deallocated later */
7997  msg_prev = msg_pu.ptr;
7998 
7999  return msg_pu.ptr;
8000 }
8001 
8007 {
8008  return getInternalMessage_centralbank_government_profit();
8009 }
8010 
8017 {
8018  return getInternalMessage_centralbank_government_profit();
8019 }
8020 
8021 
8022 /* Box filtering functions */
8023 
8024 
8025 
8026 
8028 {
8030  void *ptr_anon;
8031 };
8032 
8037 void add_housing_price_message(double price)
8038 {
8039  int rc;
8040  m_housing_price msg;
8041 
8042  msg.price = price;
8043 
8044 
8045  rc = MB_AddMessage(b_housing_price, &msg);
8046  #ifdef ERRCHECK
8047  if (rc != MB_SUCCESS)
8048  {
8049  fprintf(stderr, "ERROR: Could not add message to 'housing_price' board\n");
8050  switch(rc) {
8051  case MB_ERR_INVALID:
8052  fprintf(stderr, "\t reason: 'housing_price' board has not been created?\n");
8053  break;
8054  case MB_ERR_MEMALLOC:
8055  fprintf(stderr, "\t reason: out of memory\n");
8056  break;
8057  case MB_ERR_LOCKED:
8058  fprintf(stderr, "\t reason: 'housing_price' board is locked\n");
8059  break;
8060  case MB_ERR_INTERNAL:
8061  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8062  break;
8063  default:
8064  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8065  break;
8066  }
8067 
8068 
8069  exit(rc);
8070  }
8071  #endif
8072 }
8073 
8074 inline static m_housing_price* getInternalMessage_housing_price(void)
8075 {
8076  static m_housing_price *msg_prev = NULL;
8077  union pu_housing_price msg_pu;
8078  int rc;
8079 
8080  /* deallocate previously returned message */
8081  if (msg_prev != NULL)
8082  {
8083  free(msg_prev);
8084  }
8085  else
8086  {
8087  rc = MB_Iterator_Rewind(i_housing_price);
8088  #ifdef ERRCHECK
8089  if (rc != MB_SUCCESS)
8090  {
8091  fprintf(stderr, "ERROR: Could not rewind 'housing_price' Iterator\n");
8092  switch(rc) {
8093  case MB_ERR_INVALID:
8094  fprintf(stderr, "\t reason: 'housing_price' Iterator has not been created?\n");
8095  break;
8096  default:
8097  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8098  break;
8099  }
8100 
8101 
8102  exit(rc);
8103  }
8104  #endif
8105  }
8106 
8107  /* get next message from iterator */
8108  rc = MB_Iterator_GetMessage(i_housing_price, &(msg_pu.ptr_anon));
8109  #ifdef ERRCHECK
8110  if (rc != MB_SUCCESS)
8111  {
8112  fprintf(stderr, "ERROR: Could not get message from 'housing_price' Iterator\n");
8113  switch(rc) {
8114  case MB_ERR_INVALID:
8115  fprintf(stderr, "\t reason: 'housing_price' Iterator has not been created?\n");
8116  break;
8117  case MB_ERR_MEMALLOC:
8118  fprintf(stderr, "\t reason: out of memory\n");
8119  break;
8120  default:
8121  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8122  break;
8123  }
8124 
8125 
8126  exit(rc);
8127  }
8128  #endif
8129 
8130  /* store pointer so memory can be deallocated later */
8131  msg_prev = msg_pu.ptr;
8132 
8133  return msg_pu.ptr;
8134 }
8135 
8141 {
8142  return getInternalMessage_housing_price();
8143 }
8144 
8151 {
8152  return getInternalMessage_housing_price();
8153 }
8154 
8155 
8156 /* Box filtering functions */
8157 
8158 
8159 
8160 
8162 {
8164  void *ptr_anon;
8165 };
8166 
8176 void add_buy_housing_message(int buyer_id, int bank_id, double liquidity, double quarterly_income, double quarterly_mortgage_paid, int mortgage_choice)
8177 {
8178  int rc;
8179  m_buy_housing msg;
8180 
8181  msg.buyer_id = buyer_id;
8182  msg.bank_id = bank_id;
8183  msg.liquidity = liquidity;
8184  msg.quarterly_income = quarterly_income;
8185  msg.quarterly_mortgage_paid = quarterly_mortgage_paid;
8186  msg.mortgage_choice = mortgage_choice;
8187 
8188 
8189  rc = MB_AddMessage(b_buy_housing, &msg);
8190  #ifdef ERRCHECK
8191  if (rc != MB_SUCCESS)
8192  {
8193  fprintf(stderr, "ERROR: Could not add message to 'buy_housing' board\n");
8194  switch(rc) {
8195  case MB_ERR_INVALID:
8196  fprintf(stderr, "\t reason: 'buy_housing' board has not been created?\n");
8197  break;
8198  case MB_ERR_MEMALLOC:
8199  fprintf(stderr, "\t reason: out of memory\n");
8200  break;
8201  case MB_ERR_LOCKED:
8202  fprintf(stderr, "\t reason: 'buy_housing' board is locked\n");
8203  break;
8204  case MB_ERR_INTERNAL:
8205  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8206  break;
8207  default:
8208  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8209  break;
8210  }
8211 
8212 
8213  exit(rc);
8214  }
8215  #endif
8216 }
8217 
8218 inline static m_buy_housing* getInternalMessage_buy_housing(void)
8219 {
8220  static m_buy_housing *msg_prev = NULL;
8221  union pu_buy_housing msg_pu;
8222  int rc;
8223 
8224  /* deallocate previously returned message */
8225  if (msg_prev != NULL)
8226  {
8227  free(msg_prev);
8228  }
8229  else
8230  {
8231  rc = MB_Iterator_Rewind(i_buy_housing);
8232  #ifdef ERRCHECK
8233  if (rc != MB_SUCCESS)
8234  {
8235  fprintf(stderr, "ERROR: Could not rewind 'buy_housing' Iterator\n");
8236  switch(rc) {
8237  case MB_ERR_INVALID:
8238  fprintf(stderr, "\t reason: 'buy_housing' Iterator has not been created?\n");
8239  break;
8240  default:
8241  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8242  break;
8243  }
8244 
8245 
8246  exit(rc);
8247  }
8248  #endif
8249  }
8250 
8251  /* get next message from iterator */
8252  rc = MB_Iterator_GetMessage(i_buy_housing, &(msg_pu.ptr_anon));
8253  #ifdef ERRCHECK
8254  if (rc != MB_SUCCESS)
8255  {
8256  fprintf(stderr, "ERROR: Could not get message from 'buy_housing' Iterator\n");
8257  switch(rc) {
8258  case MB_ERR_INVALID:
8259  fprintf(stderr, "\t reason: 'buy_housing' Iterator has not been created?\n");
8260  break;
8261  case MB_ERR_MEMALLOC:
8262  fprintf(stderr, "\t reason: out of memory\n");
8263  break;
8264  default:
8265  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8266  break;
8267  }
8268 
8269 
8270  exit(rc);
8271  }
8272  #endif
8273 
8274  /* store pointer so memory can be deallocated later */
8275  msg_prev = msg_pu.ptr;
8276 
8277  return msg_pu.ptr;
8278 }
8279 
8285 {
8286  return getInternalMessage_buy_housing();
8287 }
8288 
8295 {
8296  return getInternalMessage_buy_housing();
8297 }
8298 
8299 
8300 /* Box filtering functions */
8301 
8302 
8303 
8304 
8306 {
8308  void *ptr_anon;
8309 };
8310 
8318 void add_sell_housing_message(int seller_id, double price, int quantity, int type)
8319 {
8320  int rc;
8321  m_sell_housing msg;
8322 
8323  msg.seller_id = seller_id;
8324  msg.price = price;
8325  msg.quantity = quantity;
8326  msg.type = type;
8327 
8328 
8329  rc = MB_AddMessage(b_sell_housing, &msg);
8330  #ifdef ERRCHECK
8331  if (rc != MB_SUCCESS)
8332  {
8333  fprintf(stderr, "ERROR: Could not add message to 'sell_housing' board\n");
8334  switch(rc) {
8335  case MB_ERR_INVALID:
8336  fprintf(stderr, "\t reason: 'sell_housing' board has not been created?\n");
8337  break;
8338  case MB_ERR_MEMALLOC:
8339  fprintf(stderr, "\t reason: out of memory\n");
8340  break;
8341  case MB_ERR_LOCKED:
8342  fprintf(stderr, "\t reason: 'sell_housing' board is locked\n");
8343  break;
8344  case MB_ERR_INTERNAL:
8345  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8346  break;
8347  default:
8348  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8349  break;
8350  }
8351 
8352 
8353  exit(rc);
8354  }
8355  #endif
8356 }
8357 
8358 inline static m_sell_housing* getInternalMessage_sell_housing(void)
8359 {
8360  static m_sell_housing *msg_prev = NULL;
8361  union pu_sell_housing msg_pu;
8362  int rc;
8363 
8364  /* deallocate previously returned message */
8365  if (msg_prev != NULL)
8366  {
8367  free(msg_prev);
8368  }
8369  else
8370  {
8371  rc = MB_Iterator_Rewind(i_sell_housing);
8372  #ifdef ERRCHECK
8373  if (rc != MB_SUCCESS)
8374  {
8375  fprintf(stderr, "ERROR: Could not rewind 'sell_housing' Iterator\n");
8376  switch(rc) {
8377  case MB_ERR_INVALID:
8378  fprintf(stderr, "\t reason: 'sell_housing' Iterator has not been created?\n");
8379  break;
8380  default:
8381  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8382  break;
8383  }
8384 
8385 
8386  exit(rc);
8387  }
8388  #endif
8389  }
8390 
8391  /* get next message from iterator */
8392  rc = MB_Iterator_GetMessage(i_sell_housing, &(msg_pu.ptr_anon));
8393  #ifdef ERRCHECK
8394  if (rc != MB_SUCCESS)
8395  {
8396  fprintf(stderr, "ERROR: Could not get message from 'sell_housing' Iterator\n");
8397  switch(rc) {
8398  case MB_ERR_INVALID:
8399  fprintf(stderr, "\t reason: 'sell_housing' Iterator has not been created?\n");
8400  break;
8401  case MB_ERR_MEMALLOC:
8402  fprintf(stderr, "\t reason: out of memory\n");
8403  break;
8404  default:
8405  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8406  break;
8407  }
8408 
8409 
8410  exit(rc);
8411  }
8412  #endif
8413 
8414  /* store pointer so memory can be deallocated later */
8415  msg_prev = msg_pu.ptr;
8416 
8417  return msg_pu.ptr;
8418 }
8419 
8425 {
8426  return getInternalMessage_sell_housing();
8427 }
8428 
8435 {
8436  return getInternalMessage_sell_housing();
8437 }
8438 
8439 
8440 /* Box filtering functions */
8441 
8442 
8443 
8444 
8446 {
8448  void *ptr_anon;
8449 };
8450 
8458 void add_bought_housing_message(int buyer_id, double liquidity_spent, double mortgage_used, double annuity)
8459 {
8460  int rc;
8461  m_bought_housing msg;
8462 
8463  msg.buyer_id = buyer_id;
8464  msg.liquidity_spent = liquidity_spent;
8465  msg.mortgage_used = mortgage_used;
8466  msg.annuity = annuity;
8467 
8468 
8469  rc = MB_AddMessage(b_bought_housing, &msg);
8470  #ifdef ERRCHECK
8471  if (rc != MB_SUCCESS)
8472  {
8473  fprintf(stderr, "ERROR: Could not add message to 'bought_housing' board\n");
8474  switch(rc) {
8475  case MB_ERR_INVALID:
8476  fprintf(stderr, "\t reason: 'bought_housing' board has not been created?\n");
8477  break;
8478  case MB_ERR_MEMALLOC:
8479  fprintf(stderr, "\t reason: out of memory\n");
8480  break;
8481  case MB_ERR_LOCKED:
8482  fprintf(stderr, "\t reason: 'bought_housing' board is locked\n");
8483  break;
8484  case MB_ERR_INTERNAL:
8485  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8486  break;
8487  default:
8488  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8489  break;
8490  }
8491 
8492 
8493  exit(rc);
8494  }
8495  #endif
8496 }
8497 
8498 inline static m_bought_housing* getInternalMessage_bought_housing(void)
8499 {
8500  static m_bought_housing *msg_prev = NULL;
8501  union pu_bought_housing msg_pu;
8502  int rc;
8503 
8504  /* deallocate previously returned message */
8505  if (msg_prev != NULL)
8506  {
8507  free(msg_prev);
8508  }
8509  else
8510  {
8511  rc = MB_Iterator_Rewind(i_bought_housing);
8512  #ifdef ERRCHECK
8513  if (rc != MB_SUCCESS)
8514  {
8515  fprintf(stderr, "ERROR: Could not rewind 'bought_housing' Iterator\n");
8516  switch(rc) {
8517  case MB_ERR_INVALID:
8518  fprintf(stderr, "\t reason: 'bought_housing' Iterator has not been created?\n");
8519  break;
8520  default:
8521  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8522  break;
8523  }
8524 
8525 
8526  exit(rc);
8527  }
8528  #endif
8529  }
8530 
8531  /* get next message from iterator */
8532  rc = MB_Iterator_GetMessage(i_bought_housing, &(msg_pu.ptr_anon));
8533  #ifdef ERRCHECK
8534  if (rc != MB_SUCCESS)
8535  {
8536  fprintf(stderr, "ERROR: Could not get message from 'bought_housing' Iterator\n");
8537  switch(rc) {
8538  case MB_ERR_INVALID:
8539  fprintf(stderr, "\t reason: 'bought_housing' Iterator has not been created?\n");
8540  break;
8541  case MB_ERR_MEMALLOC:
8542  fprintf(stderr, "\t reason: out of memory\n");
8543  break;
8544  default:
8545  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8546  break;
8547  }
8548 
8549 
8550  exit(rc);
8551  }
8552  #endif
8553 
8554  /* store pointer so memory can be deallocated later */
8555  msg_prev = msg_pu.ptr;
8556 
8557  return msg_pu.ptr;
8558 }
8559 
8565 {
8566  return getInternalMessage_bought_housing();
8567 }
8568 
8575 {
8576  return getInternalMessage_bought_housing();
8577 }
8578 
8579 
8580 /* Box filtering functions */
8581 
8582 
8583 
8584 
8586 {
8588  void *ptr_anon;
8589 };
8590 
8597 void add_sold_housing_message(int seller_id, int quantity_sold, double price_sold)
8598 {
8599  int rc;
8600  m_sold_housing msg;
8601 
8602  msg.seller_id = seller_id;
8603  msg.quantity_sold = quantity_sold;
8604  msg.price_sold = price_sold;
8605 
8606 
8607  rc = MB_AddMessage(b_sold_housing, &msg);
8608  #ifdef ERRCHECK
8609  if (rc != MB_SUCCESS)
8610  {
8611  fprintf(stderr, "ERROR: Could not add message to 'sold_housing' board\n");
8612  switch(rc) {
8613  case MB_ERR_INVALID:
8614  fprintf(stderr, "\t reason: 'sold_housing' board has not been created?\n");
8615  break;
8616  case MB_ERR_MEMALLOC:
8617  fprintf(stderr, "\t reason: out of memory\n");
8618  break;
8619  case MB_ERR_LOCKED:
8620  fprintf(stderr, "\t reason: 'sold_housing' board is locked\n");
8621  break;
8622  case MB_ERR_INTERNAL:
8623  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8624  break;
8625  default:
8626  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8627  break;
8628  }
8629 
8630 
8631  exit(rc);
8632  }
8633  #endif
8634 }
8635 
8636 inline static m_sold_housing* getInternalMessage_sold_housing(void)
8637 {
8638  static m_sold_housing *msg_prev = NULL;
8639  union pu_sold_housing msg_pu;
8640  int rc;
8641 
8642  /* deallocate previously returned message */
8643  if (msg_prev != NULL)
8644  {
8645  free(msg_prev);
8646  }
8647  else
8648  {
8649  rc = MB_Iterator_Rewind(i_sold_housing);
8650  #ifdef ERRCHECK
8651  if (rc != MB_SUCCESS)
8652  {
8653  fprintf(stderr, "ERROR: Could not rewind 'sold_housing' Iterator\n");
8654  switch(rc) {
8655  case MB_ERR_INVALID:
8656  fprintf(stderr, "\t reason: 'sold_housing' Iterator has not been created?\n");
8657  break;
8658  default:
8659  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8660  break;
8661  }
8662 
8663 
8664  exit(rc);
8665  }
8666  #endif
8667  }
8668 
8669  /* get next message from iterator */
8670  rc = MB_Iterator_GetMessage(i_sold_housing, &(msg_pu.ptr_anon));
8671  #ifdef ERRCHECK
8672  if (rc != MB_SUCCESS)
8673  {
8674  fprintf(stderr, "ERROR: Could not get message from 'sold_housing' Iterator\n");
8675  switch(rc) {
8676  case MB_ERR_INVALID:
8677  fprintf(stderr, "\t reason: 'sold_housing' Iterator has not been created?\n");
8678  break;
8679  case MB_ERR_MEMALLOC:
8680  fprintf(stderr, "\t reason: out of memory\n");
8681  break;
8682  default:
8683  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8684  break;
8685  }
8686 
8687 
8688  exit(rc);
8689  }
8690  #endif
8691 
8692  /* store pointer so memory can be deallocated later */
8693  msg_prev = msg_pu.ptr;
8694 
8695  return msg_pu.ptr;
8696 }
8697 
8703 {
8704  return getInternalMessage_sold_housing();
8705 }
8706 
8713 {
8714  return getInternalMessage_sold_housing();
8715 }
8716 
8717 
8718 /* Box filtering functions */
8719 
8720 
8721 
8722 
8724 {
8726  void *ptr_anon;
8727 };
8728 
8735 void add_bank_reagency_credibility_message(int bank_id, double equity, double risky_assets)
8736 {
8737  int rc;
8739 
8740  msg.bank_id = bank_id;
8741  msg.equity = equity;
8742  msg.risky_assets = risky_assets;
8743 
8744 
8745  rc = MB_AddMessage(b_bank_reagency_credibility, &msg);
8746  #ifdef ERRCHECK
8747  if (rc != MB_SUCCESS)
8748  {
8749  fprintf(stderr, "ERROR: Could not add message to 'bank_reagency_credibility' board\n");
8750  switch(rc) {
8751  case MB_ERR_INVALID:
8752  fprintf(stderr, "\t reason: 'bank_reagency_credibility' board has not been created?\n");
8753  break;
8754  case MB_ERR_MEMALLOC:
8755  fprintf(stderr, "\t reason: out of memory\n");
8756  break;
8757  case MB_ERR_LOCKED:
8758  fprintf(stderr, "\t reason: 'bank_reagency_credibility' board is locked\n");
8759  break;
8760  case MB_ERR_INTERNAL:
8761  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8762  break;
8763  default:
8764  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8765  break;
8766  }
8767 
8768 
8769  exit(rc);
8770  }
8771  #endif
8772 }
8773 
8774 inline static m_bank_reagency_credibility* getInternalMessage_bank_reagency_credibility(void)
8775 {
8776  static m_bank_reagency_credibility *msg_prev = NULL;
8777  union pu_bank_reagency_credibility msg_pu;
8778  int rc;
8779 
8780  /* deallocate previously returned message */
8781  if (msg_prev != NULL)
8782  {
8783  free(msg_prev);
8784  }
8785  else
8786  {
8787  rc = MB_Iterator_Rewind(i_bank_reagency_credibility);
8788  #ifdef ERRCHECK
8789  if (rc != MB_SUCCESS)
8790  {
8791  fprintf(stderr, "ERROR: Could not rewind 'bank_reagency_credibility' Iterator\n");
8792  switch(rc) {
8793  case MB_ERR_INVALID:
8794  fprintf(stderr, "\t reason: 'bank_reagency_credibility' Iterator has not been created?\n");
8795  break;
8796  default:
8797  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8798  break;
8799  }
8800 
8801 
8802  exit(rc);
8803  }
8804  #endif
8805  }
8806 
8807  /* get next message from iterator */
8808  rc = MB_Iterator_GetMessage(i_bank_reagency_credibility, &(msg_pu.ptr_anon));
8809  #ifdef ERRCHECK
8810  if (rc != MB_SUCCESS)
8811  {
8812  fprintf(stderr, "ERROR: Could not get message from 'bank_reagency_credibility' Iterator\n");
8813  switch(rc) {
8814  case MB_ERR_INVALID:
8815  fprintf(stderr, "\t reason: 'bank_reagency_credibility' Iterator has not been created?\n");
8816  break;
8817  case MB_ERR_MEMALLOC:
8818  fprintf(stderr, "\t reason: out of memory\n");
8819  break;
8820  default:
8821  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8822  break;
8823  }
8824 
8825 
8826  exit(rc);
8827  }
8828  #endif
8829 
8830  /* store pointer so memory can be deallocated later */
8831  msg_prev = msg_pu.ptr;
8832 
8833  return msg_pu.ptr;
8834 }
8835 
8841 {
8842  return getInternalMessage_bank_reagency_credibility();
8843 }
8844 
8851 {
8852  return getInternalMessage_bank_reagency_credibility();
8853 }
8854 
8855 
8856 /* Box filtering functions */
8857 
8858 
8859 
8860 
8862 {
8864  void *ptr_anon;
8865 };
8866 
8872 void add_mortgage_requests_message(int bank_id, double amount)
8873 {
8874  int rc;
8875  m_mortgage_requests msg;
8876 
8877  msg.bank_id = bank_id;
8878  msg.amount = amount;
8879 
8880 
8881  rc = MB_AddMessage(b_mortgage_requests, &msg);
8882  #ifdef ERRCHECK
8883  if (rc != MB_SUCCESS)
8884  {
8885  fprintf(stderr, "ERROR: Could not add message to 'mortgage_requests' board\n");
8886  switch(rc) {
8887  case MB_ERR_INVALID:
8888  fprintf(stderr, "\t reason: 'mortgage_requests' board has not been created?\n");
8889  break;
8890  case MB_ERR_MEMALLOC:
8891  fprintf(stderr, "\t reason: out of memory\n");
8892  break;
8893  case MB_ERR_LOCKED:
8894  fprintf(stderr, "\t reason: 'mortgage_requests' board is locked\n");
8895  break;
8896  case MB_ERR_INTERNAL:
8897  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
8898  break;
8899  default:
8900  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
8901  break;
8902  }
8903 
8904 
8905  exit(rc);
8906  }
8907  #endif
8908 }
8909 
8910 inline static m_mortgage_requests* getInternalMessage_mortgage_requests(void)
8911 {
8912  static m_mortgage_requests *msg_prev = NULL;
8913  union pu_mortgage_requests msg_pu;
8914  int rc;
8915 
8916  /* deallocate previously returned message */
8917  if (msg_prev != NULL)
8918  {
8919  free(msg_prev);
8920  }
8921  else
8922  {
8923  rc = MB_Iterator_Rewind(i_mortgage_requests);
8924  #ifdef ERRCHECK
8925  if (rc != MB_SUCCESS)
8926  {
8927  fprintf(stderr, "ERROR: Could not rewind 'mortgage_requests' Iterator\n");
8928  switch(rc) {
8929  case MB_ERR_INVALID:
8930  fprintf(stderr, "\t reason: 'mortgage_requests' Iterator has not been created?\n");
8931  break;
8932  default:
8933  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
8934  break;
8935  }
8936 
8937 
8938  exit(rc);
8939  }
8940  #endif
8941  }
8942 
8943  /* get next message from iterator */
8944  rc = MB_Iterator_GetMessage(i_mortgage_requests, &(msg_pu.ptr_anon));
8945  #ifdef ERRCHECK
8946  if (rc != MB_SUCCESS)
8947  {
8948  fprintf(stderr, "ERROR: Could not get message from 'mortgage_requests' Iterator\n");
8949  switch(rc) {
8950  case MB_ERR_INVALID:
8951  fprintf(stderr, "\t reason: 'mortgage_requests' Iterator has not been created?\n");
8952  break;
8953  case MB_ERR_MEMALLOC:
8954  fprintf(stderr, "\t reason: out of memory\n");
8955  break;
8956  default:
8957  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
8958  break;
8959  }
8960 
8961 
8962  exit(rc);
8963  }
8964  #endif
8965 
8966  /* store pointer so memory can be deallocated later */
8967  msg_prev = msg_pu.ptr;
8968 
8969  return msg_pu.ptr;
8970 }
8971 
8977 {
8978  return getInternalMessage_mortgage_requests();
8979 }
8980 
8987 {
8988  return getInternalMessage_mortgage_requests();
8989 }
8990 
8991 
8992 /* Box filtering functions */
8993 
8994 
8995 
8996 
8998 {
9000  void *ptr_anon;
9001 };
9002 
9008 void add_mortgage_payment_from_sale_message(int bank_id, double amount)
9009 {
9010  int rc;
9012 
9013  msg.bank_id = bank_id;
9014  msg.amount = amount;
9015 
9016 
9017  rc = MB_AddMessage(b_mortgage_payment_from_sale, &msg);
9018  #ifdef ERRCHECK
9019  if (rc != MB_SUCCESS)
9020  {
9021  fprintf(stderr, "ERROR: Could not add message to 'mortgage_payment_from_sale' board\n");
9022  switch(rc) {
9023  case MB_ERR_INVALID:
9024  fprintf(stderr, "\t reason: 'mortgage_payment_from_sale' board has not been created?\n");
9025  break;
9026  case MB_ERR_MEMALLOC:
9027  fprintf(stderr, "\t reason: out of memory\n");
9028  break;
9029  case MB_ERR_LOCKED:
9030  fprintf(stderr, "\t reason: 'mortgage_payment_from_sale' board is locked\n");
9031  break;
9032  case MB_ERR_INTERNAL:
9033  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
9034  break;
9035  default:
9036  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
9037  break;
9038  }
9039 
9040 
9041  exit(rc);
9042  }
9043  #endif
9044 }
9045 
9046 inline static m_mortgage_payment_from_sale* getInternalMessage_mortgage_payment_from_sale(void)
9047 {
9048  static m_mortgage_payment_from_sale *msg_prev = NULL;
9049  union pu_mortgage_payment_from_sale msg_pu;
9050  int rc;
9051 
9052  /* deallocate previously returned message */
9053  if (msg_prev != NULL)
9054  {
9055  free(msg_prev);
9056  }
9057  else
9058  {
9059  rc = MB_Iterator_Rewind(i_mortgage_payment_from_sale);
9060  #ifdef ERRCHECK
9061  if (rc != MB_SUCCESS)
9062  {
9063  fprintf(stderr, "ERROR: Could not rewind 'mortgage_payment_from_sale' Iterator\n");
9064  switch(rc) {
9065  case MB_ERR_INVALID:
9066  fprintf(stderr, "\t reason: 'mortgage_payment_from_sale' Iterator has not been created?\n");
9067  break;
9068  default:
9069  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
9070  break;
9071  }
9072 
9073 
9074  exit(rc);
9075  }
9076  #endif
9077  }
9078 
9079  /* get next message from iterator */
9080  rc = MB_Iterator_GetMessage(i_mortgage_payment_from_sale, &(msg_pu.ptr_anon));
9081  #ifdef ERRCHECK
9082  if (rc != MB_SUCCESS)
9083  {
9084  fprintf(stderr, "ERROR: Could not get message from 'mortgage_payment_from_sale' Iterator\n");
9085  switch(rc) {
9086  case MB_ERR_INVALID:
9087  fprintf(stderr, "\t reason: 'mortgage_payment_from_sale' Iterator has not been created?\n");
9088  break;
9089  case MB_ERR_MEMALLOC:
9090  fprintf(stderr, "\t reason: out of memory\n");
9091  break;
9092  default:
9093  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
9094  break;
9095  }
9096 
9097 
9098  exit(rc);
9099  }
9100  #endif
9101 
9102  /* store pointer so memory can be deallocated later */
9103  msg_prev = msg_pu.ptr;
9104 
9105  return msg_pu.ptr;
9106 }
9107 
9113 {
9114  return getInternalMessage_mortgage_payment_from_sale();
9115 }
9116 
9123 {
9124  return getInternalMessage_mortgage_payment_from_sale();
9125 }
9126 
9127 
9128 /* Box filtering functions */
9129 
9130 
9131 
9132 
9134 {
9136  void *ptr_anon;
9137 };
9138 
9145 void add_mortgage_payment_message(int bank_id, double interest, double principal)
9146 {
9147  int rc;
9148  m_mortgage_payment msg;
9149 
9150  msg.bank_id = bank_id;
9151  msg.interest = interest;
9152  msg.principal = principal;
9153 
9154 
9155  rc = MB_AddMessage(b_mortgage_payment, &msg);
9156  #ifdef ERRCHECK
9157  if (rc != MB_SUCCESS)
9158  {
9159  fprintf(stderr, "ERROR: Could not add message to 'mortgage_payment' board\n");
9160  switch(rc) {
9161  case MB_ERR_INVALID:
9162  fprintf(stderr, "\t reason: 'mortgage_payment' board has not been created?\n");
9163  break;
9164  case MB_ERR_MEMALLOC:
9165  fprintf(stderr, "\t reason: out of memory\n");
9166  break;
9167  case MB_ERR_LOCKED:
9168  fprintf(stderr, "\t reason: 'mortgage_payment' board is locked\n");
9169  break;
9170  case MB_ERR_INTERNAL:
9171  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
9172  break;
9173  default:
9174  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
9175  break;
9176  }
9177 
9178 
9179  exit(rc);
9180  }
9181  #endif
9182 }
9183 
9184 inline static m_mortgage_payment* getInternalMessage_mortgage_payment(void)
9185 {
9186  static m_mortgage_payment *msg_prev = NULL;
9187  union pu_mortgage_payment msg_pu;
9188  int rc;
9189 
9190  /* deallocate previously returned message */
9191  if (msg_prev != NULL)
9192  {
9193  free(msg_prev);
9194  }
9195  else
9196  {
9197  rc = MB_Iterator_Rewind(i_mortgage_payment);
9198  #ifdef ERRCHECK
9199  if (rc != MB_SUCCESS)
9200  {
9201  fprintf(stderr, "ERROR: Could not rewind 'mortgage_payment' Iterator\n");
9202  switch(rc) {
9203  case MB_ERR_INVALID:
9204  fprintf(stderr, "\t reason: 'mortgage_payment' Iterator has not been created?\n");
9205  break;
9206  default:
9207  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
9208  break;
9209  }
9210 
9211 
9212  exit(rc);
9213  }
9214  #endif
9215  }
9216 
9217  /* get next message from iterator */
9218  rc = MB_Iterator_GetMessage(i_mortgage_payment, &(msg_pu.ptr_anon));
9219  #ifdef ERRCHECK
9220  if (rc != MB_SUCCESS)
9221  {
9222  fprintf(stderr, "ERROR: Could not get message from 'mortgage_payment' Iterator\n");
9223  switch(rc) {
9224  case MB_ERR_INVALID:
9225  fprintf(stderr, "\t reason: 'mortgage_payment' Iterator has not been created?\n");
9226  break;
9227  case MB_ERR_MEMALLOC:
9228  fprintf(stderr, "\t reason: out of memory\n");
9229  break;
9230  default:
9231  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
9232  break;
9233  }
9234 
9235 
9236  exit(rc);
9237  }
9238  #endif
9239 
9240  /* store pointer so memory can be deallocated later */
9241  msg_prev = msg_pu.ptr;
9242 
9243  return msg_pu.ptr;
9244 }
9245 
9251 {
9252  return getInternalMessage_mortgage_payment();
9253 }
9254 
9261 {
9262  return getInternalMessage_mortgage_payment();
9263 }
9264 
9265 
9266 /* Box filtering functions */
9267 
9268 
9269 
9270 
9272 {
9274  void *ptr_anon;
9275 };
9276 
9282 void add_mortgage_writeoff_message(int bank_id, double amount)
9283 {
9284  int rc;
9285  m_mortgage_writeoff msg;
9286 
9287  msg.bank_id = bank_id;
9288  msg.amount = amount;
9289 
9290 
9291  rc = MB_AddMessage(b_mortgage_writeoff, &msg);
9292  #ifdef ERRCHECK
9293  if (rc != MB_SUCCESS)
9294  {
9295  fprintf(stderr, "ERROR: Could not add message to 'mortgage_writeoff' board\n");
9296  switch(rc) {
9297  case MB_ERR_INVALID:
9298  fprintf(stderr, "\t reason: 'mortgage_writeoff' board has not been created?\n");
9299  break;
9300  case MB_ERR_MEMALLOC:
9301  fprintf(stderr, "\t reason: out of memory\n");
9302  break;
9303  case MB_ERR_LOCKED:
9304  fprintf(stderr, "\t reason: 'mortgage_writeoff' board is locked\n");
9305  break;
9306  case MB_ERR_INTERNAL:
9307  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
9308  break;
9309  default:
9310  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
9311  break;
9312  }
9313 
9314 
9315  exit(rc);
9316  }
9317  #endif
9318 }
9319 
9320 inline static m_mortgage_writeoff* getInternalMessage_mortgage_writeoff(void)
9321 {
9322  static m_mortgage_writeoff *msg_prev = NULL;
9323  union pu_mortgage_writeoff msg_pu;
9324  int rc;
9325 
9326  /* deallocate previously returned message */
9327  if (msg_prev != NULL)
9328  {
9329  free(msg_prev);
9330  }
9331  else
9332  {
9333  rc = MB_Iterator_Rewind(i_mortgage_writeoff);
9334  #ifdef ERRCHECK
9335  if (rc != MB_SUCCESS)
9336  {
9337  fprintf(stderr, "ERROR: Could not rewind 'mortgage_writeoff' Iterator\n");
9338  switch(rc) {
9339  case MB_ERR_INVALID:
9340  fprintf(stderr, "\t reason: 'mortgage_writeoff' Iterator has not been created?\n");
9341  break;
9342  default:
9343  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
9344  break;
9345  }
9346 
9347 
9348  exit(rc);
9349  }
9350  #endif
9351  }
9352 
9353  /* get next message from iterator */
9354  rc = MB_Iterator_GetMessage(i_mortgage_writeoff, &(msg_pu.ptr_anon));
9355  #ifdef ERRCHECK
9356  if (rc != MB_SUCCESS)
9357  {
9358  fprintf(stderr, "ERROR: Could not get message from 'mortgage_writeoff' Iterator\n");
9359  switch(rc) {
9360  case MB_ERR_INVALID:
9361  fprintf(stderr, "\t reason: 'mortgage_writeoff' Iterator has not been created?\n");
9362  break;
9363  case MB_ERR_MEMALLOC:
9364  fprintf(stderr, "\t reason: out of memory\n");
9365  break;
9366  default:
9367  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
9368  break;
9369  }
9370 
9371 
9372  exit(rc);
9373  }
9374  #endif
9375 
9376  /* store pointer so memory can be deallocated later */
9377  msg_prev = msg_pu.ptr;
9378 
9379  return msg_pu.ptr;
9380 }
9381 
9387 {
9388  return getInternalMessage_mortgage_writeoff();
9389 }
9390 
9397 {
9398  return getInternalMessage_mortgage_writeoff();
9399 }
9400 
9401 
9402 /* Box filtering functions */
9403 
9404 
9405 
9406 
9408 {
9410  void *ptr_anon;
9411 };
9412 
9418 void add_housing_transactions_summary_message(int quantity, double avg_price)
9419 {
9420  int rc;
9422 
9423  msg.quantity = quantity;
9424  msg.avg_price = avg_price;
9425 
9426 
9427  rc = MB_AddMessage(b_housing_transactions_summary, &msg);
9428  #ifdef ERRCHECK
9429  if (rc != MB_SUCCESS)
9430  {
9431  fprintf(stderr, "ERROR: Could not add message to 'housing_transactions_summary' board\n");
9432  switch(rc) {
9433  case MB_ERR_INVALID:
9434  fprintf(stderr, "\t reason: 'housing_transactions_summary' board has not been created?\n");
9435  break;
9436  case MB_ERR_MEMALLOC:
9437  fprintf(stderr, "\t reason: out of memory\n");
9438  break;
9439  case MB_ERR_LOCKED:
9440  fprintf(stderr, "\t reason: 'housing_transactions_summary' board is locked\n");
9441  break;
9442  case MB_ERR_INTERNAL:
9443  fprintf(stderr, "\t reason: internal error. Recompile libmoard in debug mode for more info \n");
9444  break;
9445  default:
9446  fprintf(stderr, "\t MB_AddMessage returned error code: %d (see libmboard docs for details)\n", rc);
9447  break;
9448  }
9449 
9450 
9451  exit(rc);
9452  }
9453  #endif
9454 }
9455 
9456 inline static m_housing_transactions_summary* getInternalMessage_housing_transactions_summary(void)
9457 {
9458  static m_housing_transactions_summary *msg_prev = NULL;
9459  union pu_housing_transactions_summary msg_pu;
9460  int rc;
9461 
9462  /* deallocate previously returned message */
9463  if (msg_prev != NULL)
9464  {
9465  free(msg_prev);
9466  }
9467  else
9468  {
9469  rc = MB_Iterator_Rewind(i_housing_transactions_summary);
9470  #ifdef ERRCHECK
9471  if (rc != MB_SUCCESS)
9472  {
9473  fprintf(stderr, "ERROR: Could not rewind 'housing_transactions_summary' Iterator\n");
9474  switch(rc) {
9475  case MB_ERR_INVALID:
9476  fprintf(stderr, "\t reason: 'housing_transactions_summary' Iterator has not been created?\n");
9477  break;
9478  default:
9479  fprintf(stderr, "\t MB_Iterator_Rewind returned error code: %d (see libmboard docs for details)\n", rc);
9480  break;
9481  }
9482 
9483 
9484  exit(rc);
9485  }
9486  #endif
9487  }
9488 
9489  /* get next message from iterator */
9490  rc = MB_Iterator_GetMessage(i_housing_transactions_summary, &(msg_pu.ptr_anon));
9491  #ifdef ERRCHECK
9492  if (rc != MB_SUCCESS)
9493  {
9494  fprintf(stderr, "ERROR: Could not get message from 'housing_transactions_summary' Iterator\n");
9495  switch(rc) {
9496  case MB_ERR_INVALID:
9497  fprintf(stderr, "\t reason: 'housing_transactions_summary' Iterator has not been created?\n");
9498  break;
9499  case MB_ERR_MEMALLOC:
9500  fprintf(stderr, "\t reason: out of memory\n");
9501  break;
9502  default:
9503  fprintf(stderr, "\t MB_Iterator_GetMessage returned error code: %d (see libmboard docs for details)\n", rc);
9504  break;
9505  }
9506 
9507 
9508  exit(rc);
9509  }
9510  #endif
9511 
9512  /* store pointer so memory can be deallocated later */
9513  msg_prev = msg_pu.ptr;
9514 
9515  return msg_pu.ptr;
9516 }
9517 
9523 {
9524  return getInternalMessage_housing_transactions_summary();
9525 }
9526 
9533 {
9534  return getInternalMessage_housing_transactions_summary();
9535 }
9536