Thu Apr 28 2011 17:13:54

Asterisk developer's documentation


cygload.c File Reference

Loader for Asterisk under Cygwin/windows. Open the dll, locate main, run. More...

#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
Include dependency graph for cygload.c:

Go to the source code of this file.

Typedefs

typedef int(* main_f )(int argc, char *argv[])

Functions

int main (int argc, char *argv[])

Detailed Description

Loader for Asterisk under Cygwin/windows. Open the dll, locate main, run.

Definition in file cygload.c.


Typedef Documentation

typedef int(* main_f)(int argc, char *argv[])

Definition at line 27 of file cygload.c.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 29 of file cygload.c.

{
   main_f ast_main = NULL;
   void *handle = dlopen("asterisk.dll", 0);
   if (handle)
      ast_main = (main_f)dlsym(handle, "main");
   if (ast_main)
      return ast_main(argc, argv);
   fprintf(stderr, "could not load Asterisk, %s\n", dlerror());
   return 1;   /* there was an error */
}