/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include "ptfun1_2.h"

void ptfun1_1() {
  printf("\nptfun1_1() in Ch space is called \n\n");
  return;
}

void ptfun1_2() {
  printf("\nptfun1_2() in Ch space is called \n\n");
  return;
}

int main() {
  int id;
  funcHandle  handle;

  /* set function pointer */
  ptfun1_2_setHandle(1, ptfun1_1);
  ptfun1_2_setHandle(2, ptfun1_2);

  handle = ptfun1_2_getHandle(1); /* get function pointer with event 1 */
  handle(); /* call function by function pointer */
  /* get function pointer and call function with event 2 */
  ptfun1_2_getHandle(2)();

  ptfun1_2_setHandle(2, ptfun1_1);
  ptfun1_2_getHandle(2)();

  return 0;
}
