| 834 | /* called on deferred loading of opcode plugins */ |
| 835 | |
| 836 | int csoundLoadAndInitModule(CSOUND *csound, const char *fname) |
| 837 | { |
| 838 | volatile jmp_buf tmpExitJmp; |
| 839 | volatile int err; |
| 840 | |
| 841 | err = csoundLoadExternal(csound, fname); |
| 842 | if (UNLIKELY(err != 0)) |
| 843 | return err; |
| 844 | memcpy((void*) &tmpExitJmp, (void*) &csound->exitjmp, sizeof(jmp_buf)); |
| 845 | if (UNLIKELY((err = setjmp(csound->exitjmp)) != 0)) { |
| 846 | memcpy((void*) &csound->exitjmp, (void*) &tmpExitJmp, sizeof(jmp_buf)); |
| 847 | return (err == (CSOUND_EXITJMP_SUCCESS + CSOUND_MEMORY) ? |
| 848 | CSOUND_MEMORY : CSOUND_INITIALIZATION); |
| 849 | } |
| 850 | /* NOTE: this depends on csound->csmodule_db being the most recently */ |
| 851 | /* loaded plugin library */ |
| 852 | |
| 853 | err = csoundInitModule(csound, (csoundModule_t*) csound->csmodule_db); |
| 854 | memcpy((void*) &csound->exitjmp, (void*) &tmpExitJmp, sizeof(jmp_buf)); |
| 855 | |
| 856 | return err; |
| 857 | } |
| 858 | |
| 859 | int csoundLoadAndInitModules(CSOUND *csound, const char *opdir) |
| 860 | { |
no test coverage detected