File: loadfontforge.h

package info (click to toggle)
fontforge 20120731.b-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 37,776 kB
  • sloc: ansic: 557,571; sh: 10,071; makefile: 75; python: 11; xml: 11
file content (47 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "Python.h"
#include "../inc/dynamic.h"

#if defined(__Mac)
# undef dlopen
#endif

PyMODINIT_FUNC ENTRY_POINT(void) {
    DL_CONST void *lib;
    void (*initer)(void);

    if ( (lib = dlopen("libgunicode" SO_EXT,RTLD_LAZY))==NULL ) {
#ifdef PREFIX
	lib = dlopen( PREFIX "/lib/" "libgunicode.so.3.0.2", RTLD_LAZY);
#endif
    }
    if ( lib==NULL ) {
	PyErr_Format(PyExc_SystemError,"Missing library: %s", "libgunicode");
return;
    }

    if ( (lib = dlopen("libgutils" SO_EXT,RTLD_LAZY))==NULL ) {
#ifdef PREFIX
	lib = dlopen( PREFIX "/lib/" "libgutils.so.1.0.3", RTLD_LAZY);
#endif
    }
    if ( lib==NULL ) {
	PyErr_Format(PyExc_SystemError,"Missing library: %s", "libgutils");
return;
    }

    if ( (lib = dlopen("libfontforge" SO_EXT,RTLD_LAZY))==NULL ) {
#ifdef PREFIX
	lib = dlopen( PREFIX "/lib/" "libfontforge.so.1.0.0", RTLD_LAZY);
#endif
    }
    if ( lib==NULL ) {
	PyErr_Format(PyExc_SystemError,"Missing library: %s", "libfontforge");
return;
    }
    initer = dlsym(lib,"ff_init");
    if ( initer==NULL ) {
	PyErr_Format(PyExc_SystemError,"No initialization function in fontforge library");
return;
    }
    (*initer)();
}