Logo Search packages:      
Sourcecode: csound version File versions  Download package

PUBLIC int csoundInitialize ( int *  argc,
char ***  argv,
int  flags 
)

Initialise Csound library; should be called once before creating any Csound instances. Return value is zero on success, positive if initialisation was done already, and negative on error.

Definition at line 824 of file csound.c.

References CSOUNDINIT_NO_SIGNAL_HANDLER, and csoundInitialize().

Referenced by csoundCreate(), and csoundInitialize().

  {
    int     n;

    (void) argc;
    (void) argv;
    do {
      csoundLock();
      n = init_done;
      switch (n) {
      case 2:
        csoundUnLock();
        csoundSleep(1);
      case 0:
        break;
      default:
        csoundUnLock();
        return n;
      }
    } while (n);
    init_done = 2;
    csoundUnLock();
    init_getstring();
    if (getTimeResolution() != 0) {
      csoundLock(); init_done = -1; csoundUnLock();
      return -1;
    }
    if (!(flags & CSOUNDINIT_NO_SIGNAL_HANDLER))
      install_signal_handler();
    if (!(flags & CSOUNDINIT_NO_ATEXIT))
      atexit(destroy_all_instances);
    aops_init_tables();
    csoundLock(); init_done = 1; csoundUnLock();
    return 0;
  }


Generated by  Doxygen 1.6.0   Back to index