gnupos-cvs Mailing List for GnuPOS (Page 3)
Status: Pre-Alpha
Brought to you by:
conrad_c
You can subscribe to this list here.
2003 |
Jan
(35) |
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <con...@us...> - 2003-01-01 14:09:57
|
Update of /cvsroot/gnupos/gnupos/src In directory sc8-pr-cvs1:/tmp/cvs-serv30543/src Modified Files: GnuPOS-xml-P.h GnuPOSxml.c Log Message: Fixes to xml parsing, work on making the executable do what it should.... :-) Index: GnuPOS-xml-P.h =================================================================== RCS file: /cvsroot/gnupos/gnupos/src/GnuPOS-xml-P.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GnuPOS-xml-P.h 26 Dec 2002 12:50:43 -0000 1.9 --- GnuPOS-xml-P.h 1 Jan 2003 14:09:53 -0000 1.10 *************** *** 4,8 **** #include <gnome-xml/xmlmemory.h> #include <gnome-xml/parser.h> ! #include <ltdl.h> /* The keysym table */ --- 4,8 ---- #include <gnome-xml/xmlmemory.h> #include <gnome-xml/parser.h> ! #include <dlfcn.h> /* The keysym table */ *************** *** 48,52 **** guint param_count; guint register_flag; ! lt_dlhandle handle; void *next; } --- 48,53 ---- guint param_count; guint register_flag; ! gchar *library_path; ! void *handle; void *next; } Index: GnuPOSxml.c =================================================================== RCS file: /cvsroot/gnupos/gnupos/src/GnuPOSxml.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GnuPOSxml.c 29 Dec 2002 15:00:40 -0000 1.13 --- GnuPOSxml.c 1 Jan 2003 14:09:53 -0000 1.14 *************** *** 704,708 **** gchar *name = NULL; gchar *guile_name = NULL; ! lt_dlhandle myhandle; gboolean validtopok = FALSE; void (*initialise)(); --- 704,708 ---- gchar *name = NULL; gchar *guile_name = NULL; ! void *myhandle=0; gboolean validtopok = FALSE; void (*initialise)(); *************** *** 892,895 **** --- 892,898 ---- if (current == NULL) { + if(gnp_debug) + printf(" Initialising External Function structure.\n"); + top = g_malloc (sizeof (extern_func_struct)); if (top == NULL) *************** *** 904,907 **** --- 907,913 ---- else { + if(gnp_debug) + printf(" Adding to External Function structure.\n"); + current->next = g_malloc (sizeof (extern_func_struct)); if (current->next == NULL) *************** *** 918,921 **** --- 924,928 ---- current->param_count = param_count; current->register_flag = 0; + current->handle=NULL; current->next = NULL; efs_current=current; *************** *** 1039,1042 **** --- 1046,1050 ---- current->param_count = typed; current->register_flag = 1; + current->handle=NULL; current->next = NULL; efs_current=current; *************** *** 1086,1090 **** printf(" Determined library to be of external type.\n"); ! x = lt_dlinit (); if (x != 0) { --- 1094,1099 ---- printf(" Determined library to be of external type.\n"); ! /* Testing: Move this stuff to gnp_load_dynlibsyms() ! x = dlinit (); if (x != 0) { *************** *** 1092,1097 **** exit (-1); } ! myhandle = lt_dlopen (path); ! if(myhandle==0) { printf("ERROR: Library \"%s\" could not be opened. ABORTING.\n",path); --- 1101,1110 ---- exit (-1); } ! ! if(gnp_debug) ! printf(" Opening library %s\n",path); ! ! myhandle = dlopen (path,RTLD_LAZY); ! if(myhandle==NULL) { printf("ERROR: Library \"%s\" could not be opened. ABORTING.\n",path); *************** *** 1099,1114 **** } current = top; while (current != NULL) { current->handle=myhandle; current = current->next; } ! if(init_routine!=NULL) { initialise=lt_dlsym(myhandle,init_routine); initialise(); ! } } else --- 1112,1133 ---- } + if(gnp_debug) + printf(" Library opened, handle is %x.\n",myhandle); + */ current = top; while (current != NULL) { + if(gnp_debug) + printf(" Setting handle %x for %s.\n",myhandle, current->name); current->handle=myhandle; + current->library_path = path; current = current->next; } ! /* if(init_routine!=NULL) { initialise=lt_dlsym(myhandle,init_routine); initialise(); ! } */ } else *************** *** 1504,1529 **** { ! extern_func_struct *current; void *sub; ! current = efs_top; ! while(current!=NULL) { ! sub=lt_dlsym(current->handle,current->name); if(sub==NULL) { printf("ERROR: Function %s() not found in specified library. ABORTING.\n", ! current->name); exit(-1); } ! if(current->register_flag==0) /* This is a guile function */ ! scm_make_gsubr(current->other_name,current->param_count,0,0,sub); else ! if(current->register_flag==1) /* This is a register callback */ ! gnp_add_register_callback(current->other_name, sub, ! current->parameter_string, current->param_count); else { --- 1523,1652 ---- { ! extern_func_struct *ecurrent; void *sub; ! typedef struct { ! char *path; ! void *handle; ! void *next; ! } libstruct; ! ! libstruct *lstop=NULL, *lsfound, *lscurrent; ! int x; ! ! if(gnp_debug) ! printf("In gnp_load_dynlibsyms.\n"); ! ! if(efs_top!=NULL) ! { ! /* if(gnp_debug) ! printf(" Initialising libltdl.\n"); ! ! x = lt_dlinit (); ! if (x != 0) ! { ! printf ("ERROR: dl_init() returns an error. ABORTING.\n"); ! exit (-1); ! } */ ! } ! else ! return; ! ! ecurrent = efs_top; ! while(ecurrent!=NULL) ! { ! if(gnp_debug) ! printf(" Locating function \"%s\" in library %s.\n",ecurrent->name,ecurrent->library_path); ! ! lscurrent=lstop; ! lsfound=NULL; ! ! while(lscurrent!=NULL&&lsfound==NULL) ! { ! if(!strcmp(lscurrent->path,ecurrent->library_path)) ! { ! if(gnp_debug) ! printf(" Found in tree.\n"); ! lsfound=lscurrent; ! } ! lscurrent=lscurrent->next; ! } ! ! if(lsfound==NULL) ! { ! if(gnp_debug) ! printf(" Not found in library tree.\n"); ! ! if(lstop==NULL) ! { ! if(gnp_debug) ! printf(" Initialising library tree.\n"); ! ! lstop=g_malloc(sizeof(libstruct)); ! /* FIXME: Put error checking here! */ ! lscurrent=lstop; ! } ! else ! { ! if(gnp_debug) ! printf(" Adding to library tree.\n"); ! ! lscurrent->next=g_malloc(sizeof(libstruct)); ! /* FIXME: Put error checking here */ ! lscurrent=lscurrent->next; ! } ! lscurrent->path=ecurrent->library_path; ! ! if(gnp_debug) ! printf(" Opening library %s\n",lscurrent->path); ! ! lscurrent->handle = dlopen (lscurrent->path, RTLD_LAZY); ! if(lscurrent->handle==NULL) ! { ! printf("ERROR: Library \"%s\" could not be opened. ABORTING.\n",lscurrent->path); ! exit(-1); ! } ! ! if(gnp_debug) ! printf(" Library opened, handle is %p.\n",lscurrent->handle); ! ! lsfound=lscurrent; ! } ! ! ecurrent->handle=lsfound->handle; ! ! if(gnp_debug) ! printf("Sym: \"%s\", Library handle: %p\n",ecurrent->name, ecurrent->handle); ! ! sub=dlsym(ecurrent->handle,ecurrent->name); ! ! printf("And now we're here.\n"); ! if(sub==NULL) { printf("ERROR: Function %s() not found in specified library. ABORTING.\n", ! ecurrent->name); exit(-1); } ! if(ecurrent->register_flag==0) ! { ! if(gnp_debug) ! printf(" - Function identified as a guile function called \"%s\".\n", ! ecurrent->other_name); /* This is a guile function */ ! scm_make_gsubr(ecurrent->other_name,ecurrent->param_count,0,0,sub); ! } else ! if(ecurrent->register_flag==1) ! { ! if(gnp_debug) ! printf(" - Function identified as a callback function called \"%s\".\n", ! ecurrent->other_name); /* This is a register callback */ ! gnp_add_register_callback(ecurrent->other_name, sub, ! ecurrent->parameter_string, ecurrent->param_count); ! } else { *************** *** 1531,1534 **** --- 1654,1658 ---- exit(-1); } + ecurrent=ecurrent->next; } |