diff --git a/ChangeLog b/ChangeLog index b354790..f6f303c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2005-03-06 James Rich +- Removed glib dependancies + 2005-02-24 James Rich - Added more descriptive comments to tn5250_session_query_reply(). - Changed tn5250_terminal_enhanced() to return 0 if NULL as suggested by diff --git a/README b/README index 3ceec31..1411f69 100644 --- a/README +++ b/README @@ -35,23 +35,6 @@ You may receive an error the first time you run this script. If so, run the script a second time to make sure you don't get an error (this is a bug with automake). -Glib Dependency -=============== - -Versions 0.17.x and up also require a developers version of glib to be -installed. On Linux, this means that you have to install the glib-devel -package. On FreeBSD, you need to install the glib12 port. (from the ports -collection) - -On FreeBSD (and possibly some other systems) the "glib-config" script is -installed as "glib12-config". To allow tn5250 to find it, you need to set -the GLIB_CONFIG environment variable. - -For example, a csh/tcsh user might type: - setenv GLIB_CONFIG /usr/local/bin/glib12-config -or under sh/bash: - export GLIB_CONFIG=/usr/local/bin/glib12-config - Building and Installing ======================= @@ -95,6 +78,7 @@ http://www.midrange.com/linux5250.shtml - linux5250 List Info http://archive.midrange.com/linux5250/index.htm - linux5250 List Archives http://sourceforge.net/projects/tn5250/ - linux5250 at Sourceforge http://perso.libertysurf.fr/plinux/tn5250-faq.html - linux5250 FAQ +http://www.chowhouse.com/~james/tn5250-HOWTO.pdf - linux5250 HOWTO Comments, questions, bug reports and patches are much appreciated - please subscribe to the list and post them there if at all possible. If that's too diff --git a/configure.in b/configure.in index 537f8f9..7ece1c8 100644 --- a/configure.in +++ b/configure.in @@ -27,11 +27,6 @@ AC_ARG_ENABLE(old-keys, AC_DEFINE_UNQUOTED(USE_OWN_KEY_PARSING,1) ]) -dnl * -dnl * This version of TN5250 depends on GLIB 2.0 -dnl * -AM_PATH_GLIB_2_0 - dnl ************************************************************************** dnl * Python interface support. * dnl ************************************************************************** diff --git a/src/Makefile.am b/src/Makefile.am index f2aa88a..bd36e8c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,9 +32,9 @@ lib5250_la_SOURCES = buffer.c\ macro.c\ window.c -lib5250_la_LIBADD = @with_extra_libs@ @GLIB_LIBS@ +lib5250_la_LIBADD = @with_extra_libs@ -INCLUDES = @GLIB_CFLAGS@ @PYTHON_CFLAGS@ \ +INCLUDES = @PYTHON_CFLAGS@ \ -DSYSCONFDIR=\"$(sysconfdir)\" # Here's where we build the python module. @@ -46,7 +46,7 @@ pyso_LTLIBRARIES = libtn5250module.la # just add all the SOURCES (sigh). # libtn5250module_la_LIBADD = lib5250.la -libtn5250module_la_LIBADD = @with_exra_libs@ @GLIB_LIBS@ +libtn5250module_la_LIBADD = @with_exra_libs@ libtn5250module_la_SOURCES = tn5250-python.c\ $(lib5250_la_SOURCES) diff --git a/src/buffer.c b/src/buffer.c index 9ab3ab6..e0a3d4d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -52,7 +52,7 @@ void tn5250_buffer_init(Tn5250Buffer * This) void tn5250_buffer_free(Tn5250Buffer * This) { if (This->data != NULL) - g_free(This->data); + free(This->data); This->data = NULL; This->len = This->allocated = 0; } @@ -75,10 +75,10 @@ void tn5250_buffer_append_byte(Tn5250Buffer * This, unsigned char b) if (This->len + 1 >= This->allocated) { if (This->data == NULL) { This->allocated = BUFFER_DELTA; - This->data = (unsigned char *) g_malloc(This->allocated); + This->data = (unsigned char *) malloc(This->allocated); } else { This->allocated += BUFFER_DELTA; - This->data = (unsigned char *) g_realloc(This->data, This->allocated); + This->data = (unsigned char *) realloc(This->data, This->allocated); } } TN5250_ASSERT (This->data != NULL); diff --git a/src/conf.c b/src/conf.c index 2cb59d1..408ad31 100644 --- a/src/conf.c +++ b/src/conf.c @@ -22,14 +22,14 @@ #define MAX_PREFIX_STACK 50 -static void tn5250_config_str_destroy (Tn5250ConfigStr *This); -static Tn5250ConfigStr *tn5250_config_str_new (const char *name, - const int type, - const gpointer value); -static Tn5250ConfigStr *tn5250_config_get_str (Tn5250Config *This, const char *name); -static void tn5250_config_replace_vars(char *buf, int maxlen); -static void tn5250_config_replacedata(const char *from, const char *to, - char *line, int maxlen); +static void tn5250_config_str_destroy (Tn5250ConfigStr * This); +static Tn5250ConfigStr *tn5250_config_str_new (const char *name, + const char *value); +static Tn5250ConfigStr *tn5250_config_get_str (Tn5250Config * This, + const char *name); +static void tn5250_config_replace_vars (char *buf, int maxlen); +static void tn5250_config_replacedata (const char *from, const char *to, + char *line, int maxlen); #ifdef WIN32 #define snprintf _snprintf #define vsnprintf _vsnprintf @@ -37,285 +37,323 @@ static void tn5250_config_replacedata(const char *from, const char *to, /*** Tn5250ConfigStr ***/ -static void tn5250_config_str_destroy (Tn5250ConfigStr *This) +static void +tn5250_config_str_destroy (Tn5250ConfigStr * This) { - GSList * iter; - - g_free (This->name); - - if(This->type == CONFIG_STRING) { - g_free (This->value); - } else { - iter = This->value; - while(iter != NULL) - { - g_free(iter->data); - iter = g_slist_next(iter); - } - g_slist_free(This->value); - } + if (This->name != NULL) + free (This->name); + if (This->value != NULL) + free (This->value); free (This); + return; } -static Tn5250ConfigStr *tn5250_config_str_new (const char *name, - const int type, - const gpointer value) +static Tn5250ConfigStr * +tn5250_config_str_new (const char *name, const char *value) { - Tn5250ConfigStr *This = g_new (Tn5250ConfigStr, 1); - - This->name = (char *)g_malloc (strlen (name)+1); + Tn5250ConfigStr *This = tn5250_new (Tn5250ConfigStr, 1); + if (This == NULL) + return NULL; - strcpy (This->name, name); - - This->type = type; - - if(This->type == CONFIG_STRING) { - This->value = (char *)g_malloc (strlen (value)+1); + This->name = (char *) malloc (strlen (name) + 1); + if (This->name == NULL) + { + free (This); + return NULL; + } + strcpy (This->name, name); - strcpy (This->value, value); - } else { - This->value = value; - } + This->value = (char *) malloc (strlen (value) + 1); + if (This->value == NULL) + { + free (This->name); + free (This); + return NULL; + } + strcpy (This->value, value); - return This; + return This; } /*** Tn5250Config ***/ -Tn5250Config *tn5250_config_new () +Tn5250Config * +tn5250_config_new () { - Tn5250Config *This = g_new (Tn5250Config, 1); + Tn5250Config *This = tn5250_new (Tn5250Config, 1); + if (This == NULL) + return NULL; - This->ref = 1; - This->vars = NULL; + This->ref = 1; + This->vars = NULL; - return This; + return This; } -Tn5250Config *tn5250_config_ref (Tn5250Config *This) +Tn5250Config * +tn5250_config_ref (Tn5250Config * This) { - This->ref++; - return This; + This->ref++; + return This; } -void tn5250_config_unref (Tn5250Config *This) +void +tn5250_config_unref (Tn5250Config * This) { - GSList * next; - - if(-- This->ref == 0) { - next = This->vars; - - while(next != NULL) - { - tn5250_config_str_destroy(next->data); - next = g_slist_next(next); - } - g_slist_free(This->vars); - g_free(This); - } - + if (--This->ref == 0) + { + Tn5250ConfigStr *iter, *next; + + /* Destroy all vars. */ + if ((iter = This->vars) != NULL) + { + do + { + next = iter->next; + tn5250_config_str_destroy (iter); + iter = next; + } + while (iter != This->vars); + } + free (This); + } + return; } -int tn5250_config_load (Tn5250Config *This, const char *filename) +int +tn5250_config_load (Tn5250Config * This, const char *filename) { - FILE *f; - char buf[128]; - char *scan; - int len; - int prefix_stack_size = 0; - char *prefix_stack[MAX_PREFIX_STACK]; - GSList * list; - int done; - char * curitem; - GSList * temp; - int name_len, i; - char *name; - - /* It is not an error for a config file not to exist. */ - if ((f = fopen (filename, "r")) == NULL) - return errno == ENOENT ? 0 : -1; - - while (fgets (buf, sizeof(buf)-1, f)) { - buf[sizeof (buf)-1] = '\0'; + FILE *f; + char buf[128]; + char *scan; + int len; + int prefix_stack_size = 0; + char *prefix_stack[MAX_PREFIX_STACK]; + char *list[100]; + int done; + int curitem; + int loop; + int name_len, i; + char *name; + + /* It is not an error for a config file not to exist. */ + if ((f = fopen (filename, "r")) == NULL) + return errno == ENOENT ? 0 : -1; + + while (fgets (buf, sizeof (buf) - 1, f)) + { + buf[sizeof (buf) - 1] = '\0'; if (strchr (buf, '\n')) - *strchr (buf, '\n') = '\0'; + *strchr (buf, '\n') = '\0'; - tn5250_config_replace_vars(buf, sizeof(buf)); + tn5250_config_replace_vars (buf, sizeof (buf)); scan = buf; while (*scan && isspace (*scan)) - scan++; + scan++; if (*scan == '#' || *scan == '\0') - continue; + continue; - if (*scan == '+') { - scan++; - while (*scan && isspace (*scan)) + if (*scan == '+') + { + scan++; + while (*scan && isspace (*scan)) scan++; - len = strlen (scan) - 1; - while (len > 0 && isspace (scan[len])) + len = strlen (scan) - 1; + while (len > 0 && isspace (scan[len])) scan[len--] = '\0'; - for (i = 0, name_len = len + 3; i < prefix_stack_size; i++) { - name_len += strlen (prefix_stack[i]) + 1; - } - name = (char*)g_malloc (name_len); - name[0] = '\0'; - for (i = 0; i < prefix_stack_size; i++) { - strcat (name, prefix_stack[i]); - strcat (name, "."); - } - strcat(name, scan); - tn5250_config_set (This, name, CONFIG_STRING, "1"); - g_free(name); - - } else if (*scan == '-') { - scan++; - while (*scan && isspace (*scan)) + for (i = 0, name_len = len + 3; i < prefix_stack_size; i++) + { + name_len += strlen (prefix_stack[i]) + 1; + } + if ((name = (char *) malloc (name_len)) == NULL) + goto config_error; + name[0] = '\0'; + for (i = 0; i < prefix_stack_size; i++) + { + strcat (name, prefix_stack[i]); + strcat (name, "."); + } + strcat (name, scan); + tn5250_config_set (This, name, "1"); + free (name); + + } + else if (*scan == '-') + { + scan++; + while (*scan && isspace (*scan)) scan++; - len = strlen (scan) - 1; - while (len > 0 && isspace (scan[len])) + len = strlen (scan) - 1; + while (len > 0 && isspace (scan[len])) scan[len--] = '\0'; - - for (i = 0, name_len = len + 3; i < prefix_stack_size; i++) { - name_len += strlen (prefix_stack[i]) + 1; - } - name = (char*)g_malloc (name_len); - name[0] = '\0'; - for (i = 0; i < prefix_stack_size; i++) { - strcat (name, prefix_stack[i]); - strcat (name, "."); - } - strcat(name, scan); - tn5250_config_set (This, name, CONFIG_STRING, "0"); - g_free(name); - - } else if (strchr (scan, '=')) { - - /* Set item. */ - - len = 0; - while (scan[len] && !isspace (scan[len]) && scan[len] != '=') + for (i = 0, name_len = len + 3; i < prefix_stack_size; i++) + { + name_len += strlen (prefix_stack[i]) + 1; + } + if ((name = (char *) malloc (name_len)) == NULL) + goto config_error; + name[0] = '\0'; + for (i = 0; i < prefix_stack_size; i++) + { + strcat (name, prefix_stack[i]); + strcat (name, "."); + } + strcat (name, scan); + tn5250_config_set (This, name, "0"); + free (name); + + } + else if (strchr (scan, '=')) + { + + /* Set item. */ + + len = 0; + while (scan[len] && !isspace (scan[len]) && scan[len] != '=') len++; - if (len == 0) - goto config_error; /* Missing variable name. */ + if (len == 0) + goto config_error; /* Missing variable name. */ - for (i = 0, name_len = len + 3; i < prefix_stack_size; i++) { - name_len += strlen (prefix_stack[i]) + 1; - } + for (i = 0, name_len = len + 3; i < prefix_stack_size; i++) + { + name_len += strlen (prefix_stack[i]) + 1; + } - name = (char*)g_malloc (name_len); + if ((name = (char *) malloc (name_len)) == NULL) + goto config_error; - name[0] = '\0'; + name[0] = '\0'; + for (i = 0; i < prefix_stack_size; i++) + { + strcat (name, prefix_stack[i]); + strcat (name, "."); + } + name_len = strlen (name) + len; + memcpy (name + strlen (name), scan, len); + name[name_len] = '\0'; + + scan += len; + while (*scan && isspace (*scan)) + scan++; - for (i = 0; i < prefix_stack_size; i++) { - strcat (name, prefix_stack[i]); - strcat (name, "."); - } - name_len = strlen(name) + len; - memcpy (name + strlen (name), scan, len); - name[name_len] = '\0'; + if (*scan != '=') + { + free (name); + goto config_error; + } + scan++; - scan += len; - while (*scan && isspace (*scan)) + while (*scan && isspace (*scan)) scan++; - if (*scan != '=') { - g_free (name); - goto config_error; - } - scan++; - - while (*scan && isspace (*scan)) - scan++; - - if(*scan == '[') { - done = 0; - list = NULL; - while(!done) { - fgets (buf, sizeof(buf)-1, f); - buf[sizeof (buf)-1] = '\0'; - if (strchr (buf, '\n')) - *strchr (buf, '\n') = '\0'; - - scan = buf; - - while(*scan && isspace(*scan)) - scan++; - - if(*scan == ']') { - done = 1; - } else { - curitem = g_malloc(strlen(scan)+1); - strcpy(curitem, scan); - curitem[strlen(curitem)] = '\0'; - list = g_slist_append(list, curitem); - } - } - tn5250_config_set(This, name, CONFIG_LIST, (gpointer)list); - - } else { - - len = strlen (scan) - 1; - while (len > 0 && isspace (scan[len])) - scan[len--] = '\0'; - - tn5250_config_set (This, name, CONFIG_STRING, scan); - g_free (name); - } - } else if (strchr (scan, '{')) { - - /* Push level. */ - - len = 0; - while (scan[len] && !isspace (scan[len]) && scan[len] != '{') + if (*scan == '[') + { + done = 0; + curitem = 0; + while (!done) + { + fgets (buf, sizeof (buf) - 1, f); + buf[sizeof (buf) - 1] = '\0'; + if (strchr (buf, '\n')) + *strchr (buf, '\n') = '\0'; + + scan = buf; + + while (*scan && isspace (*scan)) + scan++; + + if (*scan == ']') + { + done = 1; + } + else + { + list[curitem] = malloc (strlen (scan) + 1); + strcpy (list[curitem], scan); + curitem++; + } + + } + for (loop = 0; loop < curitem; loop++) + { + printf ("%s\n", list[loop]); + } + + + } + else + { + + len = strlen (scan) - 1; + while (len > 0 && isspace (scan[len])) + scan[len--] = '\0'; + + tn5250_config_set (This, name, scan); + free (name); + } + } + else if (strchr (scan, '{')) + { + + /* Push level. */ + + len = 0; + while (scan[len] && !isspace (scan[len]) && scan[len] != '{') len++; - if (len == 0) - goto config_error; /* Missing section name. */ + if (len == 0) + goto config_error; /* Missing section name. */ - TN5250_ASSERT (prefix_stack_size < MAX_PREFIX_STACK); - prefix_stack[prefix_stack_size] = (char*)g_malloc (len+1); + TN5250_ASSERT (prefix_stack_size < MAX_PREFIX_STACK); + prefix_stack[prefix_stack_size] = (char *) malloc (len + 1); + TN5250_ASSERT (prefix_stack[prefix_stack_size] != NULL); - memcpy (prefix_stack[prefix_stack_size], scan, len); - prefix_stack[prefix_stack_size][len] = '\0'; + memcpy (prefix_stack[prefix_stack_size], scan, len); + prefix_stack[prefix_stack_size][len] = '\0'; - prefix_stack_size++; + prefix_stack_size++; - } else if (*scan == '}') { + } + else if (*scan == '}') + { - /* Pop level. */ + /* Pop level. */ - scan++; - while (*scan && isspace (*scan)) + scan++; + while (*scan && isspace (*scan)) scan++; - if (*scan != '#' && *scan != '\0') - goto config_error; /* Garbage after '}' */ - - TN5250_ASSERT (prefix_stack_size > 0); - prefix_stack_size--; + if (*scan != '#' && *scan != '\0') + goto config_error; /* Garbage after '}' */ - g_free (prefix_stack[prefix_stack_size]); + TN5250_ASSERT (prefix_stack_size > 0); + prefix_stack_size--; - } else - goto config_error; /* Garbage line. */ - } + if (prefix_stack[prefix_stack_size] != NULL) + free (prefix_stack[prefix_stack_size]); - if (prefix_stack_size != 0) - goto config_error; + } + else + goto config_error; /* Garbage line. */ + } - fclose (f); + if (prefix_stack_size != 0) + goto config_error; - return 0; + fclose (f); + return 0; config_error: - while (prefix_stack_size > 0) { + while (prefix_stack_size > 0) + { prefix_stack_size--; - g_free (prefix_stack[prefix_stack_size]); - } - fclose (f); - return -1; + if (prefix_stack[prefix_stack_size] != NULL) + free (prefix_stack[prefix_stack_size]); + } + fclose (f); + return -1; } #ifdef __WIN32__ @@ -324,235 +362,259 @@ int tn5250_config_load (Tn5250Config *This, const char *filename) * Win32 version -- Looks for a file in the same dir as the .exe * file called "tn5250rc". */ -int tn5250_config_load_default (Tn5250Config *This) +int +tn5250_config_load_default (Tn5250Config * This) { #define PATHSIZE 1024 - LPTSTR apppath; - LPTSTR dir; - DWORD rc; - DWORD len; - LPTSTR lpMsgBuf; - - apppath = malloc(PATHSIZE+1); - TN5250_ASSERT(apppath!=NULL); - - if (GetModuleFileName(NULL, apppath, PATHSIZE)<1) { - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - lpMsgBuf, - 0, NULL - ); - TN5250_LOG(("GetModuleFileName Error: %s\n", lpMsgBuf)); - MessageBox(NULL, lpMsgBuf, "TN5250", MB_OK); - LocalFree(lpMsgBuf); - return -1; - } - - if (strrchr(apppath, '\\')) { - len = strrchr(apppath, '\\') - apppath; - apppath[len+1] = '\0'; - } - - dir = malloc(strlen(apppath) + 15); - TN5250_ASSERT(apppath!=NULL); - - strcpy(dir, apppath); - strcat(dir, "tn5250rc"); - free(apppath); - - TN5250_LOG(("Config File = %s\n", dir)); - - rc = tn5250_config_load(This, dir); - free(dir); - return rc; + LPTSTR apppath; + LPTSTR dir; + DWORD rc; + DWORD len; + LPTSTR lpMsgBuf; + + apppath = malloc (PATHSIZE + 1); + TN5250_ASSERT (apppath != NULL); + + if (GetModuleFileName (NULL, apppath, PATHSIZE) < 1) + { + FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (), + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), lpMsgBuf, 0, + NULL); + TN5250_LOG (("GetModuleFileName Error: %s\n", lpMsgBuf)); + MessageBox (NULL, lpMsgBuf, "TN5250", MB_OK); + LocalFree (lpMsgBuf); + return -1; + } + + if (strrchr (apppath, '\\')) + { + len = strrchr (apppath, '\\') - apppath; + apppath[len + 1] = '\0'; + } + + dir = malloc (strlen (apppath) + 15); + TN5250_ASSERT (apppath != NULL); + + strcpy (dir, apppath); + strcat (dir, "tn5250rc"); + free (apppath); + + TN5250_LOG (("Config File = %s\n", dir)); + + rc = tn5250_config_load (This, dir); + free (dir); + return rc; } #else - + /* * Load default configuration files. */ -int tn5250_config_load_default (Tn5250Config *This) +int +tn5250_config_load_default (Tn5250Config * This) { - struct passwd *pwent; - char *dir; - int ec; + struct passwd *pwent; + char *dir; + int ec; - if (tn5250_config_load (This, SYSCONFDIR "/tn5250rc") == -1) { + if (tn5250_config_load (This, SYSCONFDIR "/tn5250rc") == -1) + { perror (SYSCONFDIR "/tn5250rc"); return -1; - } + } - pwent = getpwuid (getuid ()); - if (pwent == NULL) { + pwent = getpwuid (getuid ()); + if (pwent == NULL) + { perror ("getpwuid"); return -1; - } - - dir = (char *)g_malloc (strlen (pwent->pw_dir) + 12); + } - strcpy (dir, pwent->pw_dir); - strcat (dir, "/.tn5250rc"); - if ((ec = tn5250_config_load (This, dir)) == -1) - perror (dir); - g_free (dir); + dir = (char *) malloc (strlen (pwent->pw_dir) + 12); + if (dir == NULL) + { + perror ("malloc"); + return -1; + } - return ec; + strcpy (dir, pwent->pw_dir); + strcat (dir, "/.tn5250rc"); + if ((ec = tn5250_config_load (This, dir)) == -1) + perror (dir); + free (dir); + return ec; } #endif -int tn5250_config_parse_argv (Tn5250Config *This, int argc, char **argv) +int +tn5250_config_parse_argv (Tn5250Config * This, int argc, char **argv) { - int argn = 1, pos = -1; - - /* FIXME: Scan and promote entries first, then parse individual - * settings. This is so that we can use a particular session but - * override one of it's settings. */ - - while (argn < argc) { - if (argv[argn][0] == '+') { - /* Set boolean option. */ - char *opt = argv[argn] + 1; - tn5250_config_set (This, opt, CONFIG_STRING, "1"); - } else if (argv[argn][0] == '-') { - /* Clear boolean option. */ - char *opt = argv[argn] + 1; - tn5250_config_set (This, opt, CONFIG_STRING, "0"); - } else if (strchr (argv[argn], '=')) { - /* Set string option. */ - char *opt; - char *val = strchr (argv[argn], '=') + 1; - opt = (char*)g_malloc (strchr(argv[argn], '=') - argv[argn] + 3); - - memcpy (opt, argv[argn], strchr(argv[argn], '=') - argv[argn] + 1); - *strchr (opt, '=') = '\0'; - tn5250_config_set (This, opt, CONFIG_STRING, val); - } else { - /* Should be profile name/connect URL. */ - tn5250_config_set(This, "host", CONFIG_STRING, argv[argn]); - tn5250_config_promote(This, argv[argn]); - } + int argn = 1; + + /* FIXME: Scan and promote entries first, then parse individual + * settings. This is so that we can use a particular session but + * override one of it's settings. */ + + while (argn < argc) + { + if (argv[argn][0] == '+') + { + /* Set boolean option. */ + char *opt = argv[argn] + 1; + tn5250_config_set (This, opt, "1"); + } + else if (argv[argn][0] == '-') + { + /* Clear boolean option. */ + char *opt = argv[argn] + 1; + tn5250_config_set (This, opt, "0"); + } + else if (strchr (argv[argn], '=')) + { + /* Set string option. */ + char *opt; + char *val = strchr (argv[argn], '=') + 1; + opt = (char *) malloc (strchr (argv[argn], '=') - argv[argn] + 3); + if (opt == NULL) + return -1; /* FIXME: Produce error message. */ + memcpy (opt, argv[argn], strchr (argv[argn], '=') - argv[argn] + 1); + *strchr (opt, '=') = '\0'; + tn5250_config_set (This, opt, val); + } + else + { + /* Should be profile name/connect URL. */ + tn5250_config_set (This, "host", argv[argn]); + tn5250_config_promote (This, argv[argn]); + } argn++; - } + } - return 0; + return 0; } -const char *tn5250_config_get (Tn5250Config *This, const char *name) +const char * +tn5250_config_get (Tn5250Config * This, const char *name) { - Tn5250ConfigStr *str = tn5250_config_get_str (This, name); - return (str == NULL ? NULL : str->value); + Tn5250ConfigStr *str = tn5250_config_get_str (This, name); + return (str == NULL ? NULL : str->value); } -int tn5250_config_get_bool (Tn5250Config *This, const char *name) +int +tn5250_config_get_bool (Tn5250Config * This, const char *name) { - const char *v = tn5250_config_get (This, name); - return (v == NULL ? 0 : - !(!strcmp (v,"off") + const char *v = tn5250_config_get (This, name); + return (v == NULL ? 0 : + !(!strcmp (v, "off") || !strcmp (v, "no") - || !strcmp (v,"0") - || !strcmp (v,"false"))); + || !strcmp (v, "0") || !strcmp (v, "false"))); } -int -tn5250_config_get_int (Tn5250Config *This, const char *name) +int +tn5250_config_get_int (Tn5250Config * This, const char *name) { - const char *v = tn5250_config_get (This, name); - - if(v == NULL) { - return 0; - } else { - return(atoi(v)); - } + const char *v = tn5250_config_get (This, name); + + if (v == NULL) + { + return 0; + } + else + { + return (atoi (v)); + } } -void tn5250_config_set (Tn5250Config *This, const char *name, - const int type, const gpointer value) +void +tn5250_config_set (Tn5250Config * This, const char *name, const char *value) { - Tn5250ConfigStr *str = tn5250_config_get_str (This, name); + Tn5250ConfigStr *str = tn5250_config_get_str (This, name); - if (str != NULL) { - if(str->type == CONFIG_STRING) { - g_free (str->value); - str->value = (char*)g_malloc (strlen (value) + 1); - - strcpy (str->value, value); - return; - } - } - - str = tn5250_config_str_new (name,type, value); + if (str != NULL) + { + if (str->value != NULL) + free (str->value); + str->value = (char *) malloc (strlen (value) + 1); + TN5250_ASSERT (str->value != NULL); + strcpy (str->value, value); + return; + } - This->vars = g_slist_append(This->vars, str); + str = tn5250_config_str_new (name, value); + if (This->vars == NULL) + This->vars = str->next = str->prev = str; + else + { + str->next = This->vars; + str->prev = This->vars->prev; + str->next->prev = str; + str->prev->next = str; + } } -void tn5250_config_unset (Tn5250Config *This, const char *name) +void +tn5250_config_unset (Tn5250Config * This, const char *name) { - Tn5250ConfigStr *str; - - if ((str = tn5250_config_get_str (This, name)) == NULL) - return; /* Not found */ + Tn5250ConfigStr *str; - This->vars = g_slist_remove(This->vars, str); + if ((str = tn5250_config_get_str (This, name)) == NULL) + return; /* Not found */ - tn5250_config_str_destroy (str); + if (This->vars == str) + This->vars = This->vars->next; + if (This->vars == str) + This->vars = NULL; + else + { + str->next->prev = str->prev; + str->prev->next = str->next; + } + tn5250_config_str_destroy (str); } /* * Copy variables prefixed with `prefix' to variables without `prefix'. */ -void tn5250_config_promote (Tn5250Config *This, const char *prefix) +void +tn5250_config_promote (Tn5250Config * This, const char *prefix) { - GSList * iter; - Tn5250ConfigStr * data; - - if ((iter = This->vars) == NULL) - return; - - do { - data = (Tn5250ConfigStr *)iter->data; - if (strlen(prefix) <= strlen( data->name ) + 2 - && !memcmp(data->name, prefix, strlen(prefix)) - && data->name[strlen(prefix)] == '.') { - tn5250_config_set(This, data->name - + strlen(prefix) + 1, - data->type, - data->value); - } - iter = g_slist_next(iter); - } while(iter != NULL); - + Tn5250ConfigStr *iter; + if ((iter = This->vars) == NULL) + return; + do + { + if (strlen (prefix) <= strlen (iter->name) + 2 + && !memcmp (iter->name, prefix, strlen (prefix)) + && iter->name[strlen (prefix)] == '.') + { + tn5250_config_set (This, iter->name + strlen (prefix) + 1, + iter->value); + } + iter = iter->next; + } + while (iter != This->vars); } -static Tn5250ConfigStr *tn5250_config_get_str (Tn5250Config *This, const char *name) +static Tn5250ConfigStr * +tn5250_config_get_str (Tn5250Config * This, const char *name) { - GSList * node; - Tn5250ConfigStr * result; + Tn5250ConfigStr *iter; - node = This->vars; + if ((iter = This->vars) == NULL) + return NULL; /* No vars */ - if ( node == NULL) + do { - return(NULL); + if (!strcmp (iter->name, name)) + return iter; + iter = iter->next; } + while (iter != This->vars); - do { - result = (Tn5250ConfigStr *)node->data; - - if( !strcmp(result->name, name) ) - { - return(result); - } - node = g_slist_next(node); - } while(node != NULL); - - return(NULL); - - + return NULL; /* Not found */ } @@ -570,28 +632,33 @@ static Tn5250ConfigStr *tn5250_config_get_str (Tn5250Config *This, const char *n * (At this time, the only var is "$loginname$".) *****/ #define USER_NAME_MAX 50 -static void tn5250_config_replace_vars(char *buf, int maxlen) { +static void +tn5250_config_replace_vars (char *buf, int maxlen) +{ #ifdef WIN32 - { - DWORD len; - char usrnam[USER_NAME_MAX+1]; - len = USER_NAME_MAX; - if (GetUserName(usrnam, &len)!=0) { - tn5250_config_replacedata("$loginname$",usrnam,buf,maxlen); - } - } + { + DWORD len; + char usrnam[USER_NAME_MAX + 1]; + len = USER_NAME_MAX; + if (GetUserName (usrnam, &len) != 0) + { + tn5250_config_replacedata ("$loginname$", usrnam, buf, maxlen); + } + } #else - { - struct passwd *pwent; - pwent = getpwuid (getuid ()); - if (pwent != NULL) { - tn5250_config_replacedata("$loginname$",pwent->pw_name,buf,maxlen); - } - } + { + struct passwd *pwent; + pwent = getpwuid (getuid ()); + if (pwent != NULL) + { + tn5250_config_replacedata ("$loginname$", pwent->pw_name, buf, + maxlen); + } + } #endif - return; + return; } @@ -610,37 +677,46 @@ static void tn5250_config_replace_vars(char *buf, int maxlen) { * the "to" string in a line of text. The from and to do not have to * be the same length. *****/ -static void tn5250_config_replacedata(const char *from, const char *to, - char *line, int maxlen) { - - char *p; - int len; - char *before, *after; - - if ((p=strstr(line, from))!=NULL) { - if (p<=line) { - before=g_malloc(1); - *before = '\0'; - } else { - len = p - line; - before = g_malloc(len+1); - memcpy(before, line, len); - before[len] = '\0'; - } - p += strlen(from); - if (strlen(p)<1) { - after = g_malloc(1); - *after = '\0'; - } else { - len = strlen(p); - after = g_malloc(len+1); - memcpy(after, p, len); - after[len] = '\0'; - } - snprintf(line, maxlen-1, "%s%s%s", before, to, after); - g_free(before); - g_free(after); - } +static void +tn5250_config_replacedata (const char *from, const char *to, + char *line, int maxlen) +{ + + char *p; + int len; + char *before, *after; + + if ((p = strstr (line, from)) != NULL) + { + if (p <= line) + { + before = malloc (1); + *before = '\0'; + } + else + { + len = p - line; + before = malloc (len + 1); + memcpy (before, line, len); + before[len] = '\0'; + } + p += strlen (from); + if (strlen (p) < 1) + { + after = malloc (1); + *after = '\0'; + } + else + { + len = strlen (p); + after = malloc (len + 1); + memcpy (after, p, len); + after[len] = '\0'; + } + snprintf (line, maxlen - 1, "%s%s%s", before, to, after); + free (before); + free (after); + } } diff --git a/src/conf.h b/src/conf.h index a5f48fb..9846d2e 100644 --- a/src/conf.h +++ b/src/conf.h @@ -24,25 +24,23 @@ extern "C" { #endif -#define CONFIG_STRING 1 -#define CONFIG_LIST 2 - struct _Tn5250ConfigStr { - char * name; - int type; - gpointer value; + struct _Tn5250ConfigStr *next; + struct _Tn5250ConfigStr *prev; + char * name; + char * value; }; typedef struct _Tn5250ConfigStr Tn5250ConfigStr; struct _Tn5250Config { - int ref; - GSList * vars; + int ref; + Tn5250ConfigStr * vars; }; typedef struct _Tn5250Config Tn5250Config; -extern Tn5250Config * tn5250_config_new (void); +extern Tn5250Config * tn5250_config_new (void); extern Tn5250Config * tn5250_config_ref (Tn5250Config *This); extern void tn5250_config_unref (Tn5250Config *This); @@ -58,11 +56,10 @@ extern const char * tn5250_config_get (Tn5250Config *This, extern int tn5250_config_get_bool (Tn5250Config *This, const char *name); extern int tn5250_config_get_int (Tn5250Config *This, - const char *name); + const char *name); extern void tn5250_config_set (Tn5250Config *This, const char *name, - const int type, - const gpointer value); + const char *value); extern void tn5250_config_unset (Tn5250Config *This, const char *name); diff --git a/src/cursesterm.c b/src/cursesterm.c index c1d9734..8de8508 100644 --- a/src/cursesterm.c +++ b/src/cursesterm.c @@ -193,9 +193,9 @@ static Key curses_vt100[] = { /* ASCII DEL is not correctly reported as the DC key in some * termcaps */ /* But it is backspace in some termcaps... */ - /* { K_DELETE, "\177" }, /* ASCII DEL */ + /* { K_DELETE, "\177" }, */ /* ASCII DEL */ { K_DELETE, "\033\133\063\176" }, /* ASCII DEL Sequence: \E[3~ */ - + /* ESC strings */ { K_F1, "\033\061" }, /* ESC 1 */ @@ -263,7 +263,7 @@ Tn5250Terminal *tn5250_curses_terminal_new() r->data = tn5250_new(struct _Tn5250TerminalPrivate, 1); if (r->data == NULL) { - g_free(r); + free(r); return NULL; } @@ -315,9 +315,7 @@ Tn5250Terminal *tn5250_curses_terminal_new() *****/ static void curses_terminal_init(Tn5250Terminal * This) { - char buf[MAX_K_BUF_LEN]; int i = 0, c, s; - struct timeval tv; char *str; int x; @@ -411,7 +409,7 @@ static void curses_terminal_init(Tn5250Terminal * This) * mappings. */ This->data->k_map_len = (sizeof (curses_vt100) / sizeof (Key)) * 2 + sizeof (curses_caps) / sizeof (Key) + 1; - This->data->k_map = (Key*)g_malloc (sizeof (Key)*This->data->k_map_len); + This->data->k_map = (Key*)malloc (sizeof (Key)*This->data->k_map_len); c = sizeof (curses_caps) / sizeof (Key); s = sizeof (curses_vt100) / sizeof (Key); @@ -514,8 +512,8 @@ void tn5250_curses_terminal_display_ruler (Tn5250Terminal *This, int f) void tn5250_curses_terminal_set_xterm_font (Tn5250Terminal *This, const char *font80, const char *font132) { - This->data->font_80 = g_malloc(strlen(font80) + 6); - This->data->font_132 = g_malloc(strlen(font132) + 6); + This->data->font_80 = malloc(strlen(font80) + 6); + This->data->font_132 = malloc(strlen(font132) + 6); sprintf(This->data->font_80, "\x1b]50;%s\x07", font80); sprintf(This->data->font_132, "\x1b]50;%s\x07", font132); TN5250_LOG(("font_80 = %s.\n",This->data->font_80)); @@ -551,15 +549,15 @@ static void curses_terminal_destroy(Tn5250Terminal * This) { #ifdef USE_OWN_KEY_PARSING if (This->data->k_map != NULL) - g_free(This->data->k_map); + free(This->data->k_map); #endif if (This->data->font_80 !=NULL) - g_free(This->data->font_80); + free(This->data->font_80); if (This->data->font_132 !=NULL) - g_free(This->data->font_132); + free(This->data->font_132); if (This->data != NULL) - g_free(This->data); - g_free(This); + free(This->data); + free(This); } /****i* lib5250/curses_terminal_width @@ -1486,8 +1484,8 @@ void curses_terminal_print_screen(Tn5250Terminal *This, Tn5250Display *display) /* allocate enough memory to store the largest possible string that we could output. Note that it could be twice the size of the screen if every single character needs to be escaped... */ - prttext = g_malloc((2 * tn5250_display_width(display) * - tn5250_display_height(display)) + 1); + prttext = malloc((2 * tn5250_display_width(display) * + tn5250_display_height(display)) + 1); out = popen(outcmd, "w"); if (out == NULL) @@ -1633,7 +1631,7 @@ void curses_terminal_print_screen(Tn5250Terminal *This, Tn5250Display *display) pclose(out); - g_free(prttext); + free(prttext); attrset(attribute_map[0]); clear(); diff --git a/src/dbuffer.c b/src/dbuffer.c index a6be529..56dd0b3 100644 --- a/src/dbuffer.c +++ b/src/dbuffer.c @@ -77,7 +77,7 @@ tn5250_dbuffer_new (int width, int height) This->data = tn5250_new (unsigned char, width * height); if (This->data == NULL) { - g_free (This); + free (This); return NULL; } @@ -118,7 +118,7 @@ tn5250_dbuffer_copy (Tn5250DBuffer * dsp) This->data = tn5250_new (unsigned char, dsp->w * dsp->h); if (This->data == NULL) { - g_free (This); + free (This); return NULL; } memcpy (This->data, dsp->data, dsp->w * dsp->h); @@ -128,7 +128,7 @@ tn5250_dbuffer_copy (Tn5250DBuffer * dsp) This->header_length = dsp->header_length; if (dsp->header_data != NULL) { - This->header_data = (unsigned char *) g_malloc (This->header_length); + This->header_data = (unsigned char *) malloc (This->header_length); memcpy (This->header_data, dsp->header_data, dsp->header_length); } else @@ -154,14 +154,14 @@ tn5250_dbuffer_copy (Tn5250DBuffer * dsp) void tn5250_dbuffer_destroy (Tn5250DBuffer * This) { - g_free (This->data); + free (This->data); if (This->header_data != NULL) { - g_free (This->header_data); + free (This->header_data); } (void) tn5250_field_list_destroy (This->field_list); (void) tn5250_window_list_destroy (This->window_list); - g_free (This); + free (This); return; } @@ -184,13 +184,13 @@ tn5250_dbuffer_set_header_data (Tn5250DBuffer * This, unsigned char *data, { if (This->header_data != NULL) { - g_free (This->header_data); + free (This->header_data); } This->header_length = len; if (data != NULL) { TN5250_ASSERT (len > 0); - This->header_data = (unsigned char *) g_malloc (len); + This->header_data = (unsigned char *) malloc (len); memcpy (This->header_data, data, len); } return; @@ -496,7 +496,7 @@ tn5250_dbuffer_clear_table (Tn5250DBuffer * This) This->header_length = 0; if (This->header_data != NULL) { - g_free (This->header_data); + free (This->header_data); This->header_data = NULL; } return; diff --git a/src/display.c b/src/display.c index baf1e9a..60250ad 100644 --- a/src/display.c +++ b/src/display.c @@ -94,15 +94,15 @@ void tn5250_display_destroy (Tn5250Display * This) tn5250_terminal_destroy (This->terminal); } if (This->saved_msg_line != NULL) { - g_free (This->saved_msg_line); + free (This->saved_msg_line); } if (This->msg_line != NULL) { - g_free (This->msg_line); + free (This->msg_line); } if (This->config != NULL) { tn5250_config_unref (This->config); } - g_free (This); + free (This); return; } @@ -139,7 +139,7 @@ int tn5250_display_config (Tn5250Display * This, Tn5250Config * config) termtype = tn5250_config_get (config, "env.TERM"); if (termtype == NULL) { - tn5250_config_set (config, "env.TERM", CONFIG_STRING, "IBM-3179-2"); + tn5250_config_set (config, "env.TERM", "IBM-3179-2"); } /* Set the new character map. */ @@ -147,7 +147,7 @@ int tn5250_display_config (Tn5250Display * This, Tn5250Config * config) tn5250_char_map_destroy (This->map); } if ((v = tn5250_config_get (config, "map")) == NULL) { - tn5250_config_set (config, "map", CONFIG_STRING, "37"); + tn5250_config_set (config, "map", "37"); v = tn5250_config_get (config, "map"); } @@ -1653,9 +1653,9 @@ void tn5250_display_indicator_clear (Tn5250Display * This, int inds) memcpy (This->display_buffers->data + l * tn5250_display_width (This), This->saved_msg_line, tn5250_display_width (This)); - g_free (This->saved_msg_line); + free (This->saved_msg_line); This->saved_msg_line = NULL; - g_free (This->msg_line); + free (This->msg_line); This->msg_line = NULL; } return; @@ -1684,11 +1684,11 @@ void tn5250_display_clear_unit (Tn5250Display * This) This->pending_insert = 0; tn5250_dbuffer_set_ic (This->display_buffers, 0, 0); if (This->saved_msg_line != NULL) { - g_free (This->saved_msg_line); + free (This->saved_msg_line); This->saved_msg_line = NULL; } if (This->msg_line != NULL) { - g_free (This->msg_line); + free (This->msg_line); This->msg_line = NULL; } return; @@ -1717,11 +1717,11 @@ void tn5250_display_clear_unit_alternate (Tn5250Display * This) This->pending_insert = 0; tn5250_dbuffer_set_ic (This->display_buffers, 0, 0); if (This->saved_msg_line != NULL) { - g_free (This->saved_msg_line); + free (This->saved_msg_line); This->saved_msg_line = NULL; } if (This->msg_line != NULL) { - g_free (This->msg_line); + free (This->msg_line); This->msg_line = NULL; } return; @@ -2304,10 +2304,10 @@ void tn5250_display_save_msg_line (Tn5250Display * This) int l; if (This->saved_msg_line != NULL) { - g_free (This->saved_msg_line); + free (This->saved_msg_line); } This->saved_msg_line = - (unsigned char *) g_malloc (tn5250_display_width (This)); + (unsigned char *) malloc (tn5250_display_width (This)); l = tn5250_dbuffer_msg_line (This->display_buffers); memcpy (This->saved_msg_line, This->display_buffers->data + @@ -2338,7 +2338,7 @@ tn5250_display_set_msg_line (Tn5250Display * This, free (This->msg_line); } This->msg_line = - (unsigned char *) g_malloc (tn5250_display_width (This)); + (unsigned char *) malloc (tn5250_display_width (This)); memset (This->msg_line, 0x00, tn5250_display_width (This)); memcpy (This->msg_line, msgline, msglen); diff --git a/src/macro.c b/src/macro.c index a436c93..cb94323 100644 --- a/src/macro.c +++ b/src/macro.c @@ -198,7 +198,7 @@ void macro_addline (int **PDest, char *Buff, int Sz) if (*PDest == NULL) { - Buffer = (int *)g_malloc((Sz+1)*sizeof(int)); + Buffer = (int *)malloc((Sz+1)*sizeof(int)); OSz = 0 ; } else @@ -272,7 +272,7 @@ void macro_clearmem (Tn5250Macro *Macro) for (i=0;i < 24;i++) if (Macro->BuffM[i] != NULL) { - g_free (Macro->BuffM[i]) ; + free (Macro->BuffM[i]) ; Macro->BuffM[i] = NULL ; } } @@ -291,7 +291,7 @@ char *macro_filename (Tn5250Display *Dsp) LPTSTR lpMsgBuf; const char *cnf ; - apppath = g_malloc(PATHSIZE+1); + apppath = malloc(PATHSIZE+1); if (GetModuleFileName(NULL, apppath, PATHSIZE)<1) { FormatMessage( @@ -313,20 +313,20 @@ char *macro_filename (Tn5250Display *Dsp) apppath[len+1] = '\0'; } - dir = g_malloc(strlen(apppath) + 15); + dir = malloc(strlen(apppath) + 15); strcpy(dir, apppath); strcat(dir, "tn5250macros"); - g_free(apppath); + free(apppath); fname = dir ; if ((cnf = tn5250_config_get (Dsp->config,"macros")) != NULL) { - fname = (char *)g_malloc (strlen(cnf)+1) ; + fname = (char *)malloc (strlen(cnf)+1) ; if (fname != NULL) { memcpy (fname,cnf,strlen(cnf)+1) ; - g_free (dir) ; + free (dir) ; } } @@ -348,7 +348,7 @@ char *macro_filename (Tn5250Display *Dsp) if (pwent == NULL) return (NULL) ; - dir = (char *)g_malloc (strlen (pwent->pw_dir) + 16); + dir = (char *)malloc (strlen (pwent->pw_dir) + 16); if (dir == NULL) return (NULL) ; @@ -358,11 +358,11 @@ char *macro_filename (Tn5250Display *Dsp) fname = dir ; if ((cnf = tn5250_config_get (Dsp->config,"macros")) != NULL) { - fname = (char *)g_malloc (strlen(cnf)+1) ; + fname = (char *)malloc (strlen(cnf)+1) ; if (fname != NULL) { memcpy (fname,cnf,strlen(cnf)+1) ; - g_free (dir) ; + free (dir) ; } } @@ -447,8 +447,7 @@ void macro_write (int Num, int *Buff, FILE *MF) char macro_savefile (Tn5250Macro *Macro) { FILE *MFile ; - int i,Sz,Num,CurMacro ; - char Buffer[MAX_LINESZ] ; + int i; if (Macro->fname != NULL) { @@ -484,10 +483,10 @@ void tn5250_macro_exit(Tn5250Macro * This) /* macro_savefile (This) ; */ if (This->fname != NULL) - g_free (This->fname) ; + free (This->fname) ; for (i=0;i<24;i++) - g_free (This->BuffM[i]) ; + free (This->BuffM[i]) ; free (This) ; } } @@ -594,7 +593,7 @@ void tn5250_macro_enddef (Tn5250Display *This) } else { - g_free (This->macro->BuffM[NumMacro]) ; + free (This->macro->BuffM[NumMacro]) ; This->macro->BuffM[NumMacro] = NULL ; } @@ -622,7 +621,7 @@ char tn5250_macro_recfunct (Tn5250Display *This, int key) if ((This->macro != NULL) && (This->macro->RState == 1)) { - Buffer = (int *)g_malloc((MACRO_BUFSIZE+1)*sizeof(int)); + Buffer = (int *)malloc((MACRO_BUFSIZE+1)*sizeof(int)); if (Buffer != NULL) { This->macro->RState = 2 ; @@ -634,13 +633,13 @@ char tn5250_macro_recfunct (Tn5250Display *This, int key) macro_loadfile (This->macro) ; if (This->macro->BuffM[NumMacro] != NULL) - g_free (This->macro->BuffM[NumMacro]) ; + free (This->macro->BuffM[NumMacro]) ; This->macro->BuffM[NumMacro] = Buffer ; This->macro->TleBuff = 0 ; return (1) ; } else - g_free (Buffer) ; + free (Buffer) ; } } return (0) ; diff --git a/src/printsession.c b/src/printsession.c index 7bfb0b9..dccd3a7 100644 --- a/src/printsession.c +++ b/src/printsession.c @@ -84,7 +84,7 @@ Tn5250PrintSession *tn5250_print_session_new() This->rec = tn5250_record_new(); if (This->rec == NULL) { - g_free (This); + free (This); return NULL; } @@ -115,10 +115,10 @@ void tn5250_print_session_destroy(Tn5250PrintSession * This) if (This->rec != NULL) tn5250_record_destroy(This->rec); if (This->output_cmd != NULL) - g_free(This->output_cmd); + free(This->output_cmd); if (This->map != NULL) tn5250_char_map_destroy (This->map); - g_free (This); + free (This); } /****f* lib5250/tn5250_print_session_set_fd @@ -188,8 +188,8 @@ void tn5250_print_session_set_char_map (Tn5250PrintSession *This, const char *ma void tn5250_print_session_set_output_command(Tn5250PrintSession * This, const char *output_cmd) { if (This->output_cmd != NULL) - g_free(This->output_cmd); - This->output_cmd = (char *) g_malloc(strlen(output_cmd) + 1); + free(This->output_cmd); + This->output_cmd = (char *) malloc(strlen(output_cmd) + 1); strcpy(This->output_cmd, output_cmd); } diff --git a/src/scs.c b/src/scs.c index ff0b50e..ae389f9 100644 --- a/src/scs.c +++ b/src/scs.c @@ -355,7 +355,6 @@ scs_ppm (Tn5250SCS * This) unsigned char formscontrol, sourcedrawer, destdraweroffset; unsigned char destdrawer, quality, duplex; unsigned char nextchar; - int loop; #ifdef DEBUG fprintf (stderr, "Begin Page Presentation Media (PPM)\n"); diff --git a/src/scs2ascii.c b/src/scs2ascii.c index 63aa2cf..e712404 100644 --- a/src/scs2ascii.c +++ b/src/scs2ascii.c @@ -70,7 +70,7 @@ main () scs_main (scs); tn5250_char_map_destroy (map); - g_free (scs); + free (scs); return (0); } @@ -94,7 +94,7 @@ tn5250_scs2ascii_new () /* scs->data = tn5250_new(struct _Tn5250SCSPrivate, 1); if (scs->data == NULL) { - g_free(scs); + free(scs); return; } */ diff --git a/src/scs2pdf.c b/src/scs2pdf.c index 031b1d4..b1d9fef 100644 --- a/src/scs2pdf.c +++ b/src/scs2pdf.c @@ -23,7 +23,6 @@ */ #include "tn5250-private.h" -#include /* #define DEBUG @@ -95,9 +94,22 @@ struct _Tn5250SCSPrivate unsigned char nextchar; Tn5250CharMap *map; -GArray *textobjects; -GArray *ObjectList; +struct _expanding_array +{ + int *data; + int elems; + int alloc; +}; +typedef struct _expanding_array expanding_array; + +expanding_array *array_new (); +void array_append_val (expanding_array * array, int value); +int array_index (expanding_array * array, int idx); +void array_free (expanding_array * array); + +expanding_array *textobjects; +expanding_array *ObjectList; FILE *outfile; @@ -109,8 +121,8 @@ main () Tn5250SCS *scs = NULL; - ObjectList = g_array_new (FALSE, FALSE, sizeof (int)); - textobjects = g_array_new (FALSE, FALSE, sizeof (int)); + ObjectList = array_new (); + textobjects = array_new (); /* This allows the user to select an output file other than stdout. @@ -180,7 +192,7 @@ main () * byte count is for the beginning of each object we use ObjectList to * track it. */ - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_begin_stream (scs->data->objcount, COURIER, scs->data->fontsize); @@ -194,12 +206,12 @@ main () scs_main (scs); - g_array_append_val (textobjects, scs->data->objcount); + array_append_val (textobjects, scs->data->objcount); scs->data->streamsize += pdf_process_char ('\0', 1); scs->data->filesize += scs->data->streamsize; scs->data->filesize += pdf_end_stream (); - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_stream_length (scs->data->objcount, scs->data->streamsize); @@ -207,7 +219,7 @@ main () fprintf (stderr, "stream length objcount = %d\n", scs->data->objcount); #endif - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_catalog (scs->data->objcount, scs->data->objcount + 1, @@ -217,14 +229,14 @@ main () fprintf (stderr, "catalog objcount = %d\n", scs->data->objcount); #endif - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_outlines (scs->data->objcount); #ifdef DEBUG fprintf (stderr, "outlines objcount = %d\n", scs->data->objcount); #endif - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_procset (scs->data->objcount); procsetobject = scs->data->objcount; @@ -236,7 +248,7 @@ main () * necessarily know if we used bold just make a bold font object anyway. * It doesn't hurt to have objects that aren't used. */ - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_font (scs->data->objcount, COURIER); fontobject = scs->data->objcount; @@ -244,7 +256,7 @@ main () fprintf (stderr, "font objcount = %d\n", scs->data->objcount); #endif - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_font (scs->data->objcount, COURIER_BOLD); boldfontobject = scs->data->objcount; @@ -270,7 +282,7 @@ main () scs->pagewidth = DEFAULT_PAGE_WIDTH + (720 * i); } } - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_pages (scs->data->objcount, scs->data->objcount + 1, @@ -282,11 +294,11 @@ main () for (i = 0; i < scs->data->pagenumber; i++) { - g_array_append_val (ObjectList, scs->data->filesize); + array_append_val (ObjectList, scs->data->filesize); scs->data->objcount++; scs->data->filesize += pdf_page (scs->data->objcount, pageparent, - g_array_index (textobjects, int, i), + array_index (textobjects, i), procsetobject, fontobject, boldfontobject, scs->pagewidth, scs->pagelength); @@ -298,10 +310,10 @@ main () pdf_xreftable (scs->data->objcount); pdf_trailer (scs->data->filesize, scs->data->objcount + 1, rootobject); - g_array_free (textobjects, TRUE); - g_array_free (ObjectList, TRUE); + array_free (textobjects); + array_free (ObjectList); tn5250_char_map_destroy (map); - g_free (scs); + free (scs); return (0); } @@ -324,7 +336,7 @@ tn5250_scs2pdf_new () scs->data = tn5250_new (struct _Tn5250SCSPrivate, 1); if (scs->data == NULL) { - g_free (scs); + free (scs); return NULL; } @@ -575,13 +587,13 @@ do_newpage (Tn5250SCS * This) * put on this page. We put one stream object on each * page. */ - g_array_append_val (textobjects, This->data->objcount); + array_append_val (textobjects, This->data->objcount); This->data->streamsize += pdf_process_char ('\0', 1); This->data->filesize += This->data->streamsize; This->data->filesize += pdf_end_stream (); - g_array_append_val (ObjectList, This->data->filesize); + array_append_val (ObjectList, This->data->filesize); This->data->objcount = This->data->objcount + 1; #ifdef DEBUG fprintf (stderr, "objcount: %d\n", This->data->objcount); @@ -597,7 +609,7 @@ do_newpage (Tn5250SCS * This) * here constitutes a new page, in conjuction with the * pdf_page() function below. */ - g_array_append_val (ObjectList, This->data->filesize); + array_append_val (ObjectList, This->data->filesize); This->data->objcount = This->data->objcount + 1; This->data->filesize += pdf_begin_stream (This->data->objcount, COURIER, This->data->fontsize); @@ -925,8 +937,7 @@ pdf_xreftable (int objnum) */ for (curobj = 0; curobj < objnum; curobj++) { - fprintf (outfile, - "%010d 00000 n \n", g_array_index (ObjectList, int, curobj)); + fprintf (outfile, "%010d 00000 n \n", array_index (ObjectList, curobj)); } } @@ -996,4 +1007,72 @@ pdf_process_char (char character, int flush) } } -/* vi:set sts=3 sw=3: */ + +expanding_array * +array_new () +{ + expanding_array *array = NULL; + + array = malloc (sizeof (expanding_array)); + if (array == NULL) + return NULL; + + array->data = NULL; + array->elems = 0; + array->alloc = 0; + + return array; +} + + +void +array_append_val (expanding_array * array, int value) +{ + int *newdata; + + array->elems++; + + if (array->elems > array->alloc) + { + array->alloc += 64; + if (array->data == NULL) + { + array->data = malloc (sizeof (int) * array->alloc); + } + else + { + newdata = realloc (array->data, sizeof (int) * array->alloc); + if (newdata == NULL) + free (array->data); + array->data = newdata; + } + if (array->data == NULL) + { + fprintf (stderr, "array_append_val: Out of memory!\n"); + exit (1); + } + } + + array->data[array->elems - 1] = value; + return; +} + + +int +array_index (expanding_array * array, int idx) +{ + return array->data[idx]; +} + + +void +array_free (expanding_array * array) +{ + if (array->data != NULL) + { + free (array->data); + } + free (array); + array = NULL; + return; +} diff --git a/src/scs2ps.c b/src/scs2ps.c index 167b32e..e6a69e6 100644 --- a/src/scs2ps.c +++ b/src/scs2ps.c @@ -113,11 +113,12 @@ main () paw = pw - lm - rm; pal = pl - tm - bm; - /* calculate width & height of each character */ - /* kluge - can't seem to cast int to float, - /* (Boy it's been a long time since I coded any C!) */ - /* so I just assigned the ints to temporary float vars */ - /* This should be fixed! */ + /* calculate width & height of each character + * kluge - can't seem to cast int to float, + * (Boy it's been a long time since I coded any C!) + * so I just assigned the ints to temporary float vars + * This should be fixed! + */ mppf = mpp; pawf = paw; charwidth = pawf / mppf; @@ -133,7 +134,7 @@ main () scs2ps_jobfooter (); tn5250_char_map_destroy (map); - g_free (scs); + free (scs); return (0); } @@ -157,7 +158,7 @@ tn5250_scs2ps_new () scs->data = tn5250_new (struct _Tn5250SCSPrivate, 1); if (scs->data == NULL) { - g_free (scs); + free (scs); return NULL; } */ diff --git a/src/session.c b/src/session.c index 4a55bbe..5bb974e 100644 --- a/src/session.c +++ b/src/session.c @@ -105,7 +105,7 @@ tn5250_session_new () This->record = tn5250_record_new (); if (This->record == NULL) { - g_free (This); + free (This); return NULL; } @@ -562,7 +562,7 @@ tn5250_session_send_field (Tn5250Session * This, Tn5250Buffer * buf, } } - data = g_malloc (size); + data = malloc (size); /* 2nd loop: Copy the data in the temporary buffer */ for (iter = field; iter->continuous; iter = iter->next) { @@ -675,7 +675,7 @@ tn5250_session_send_field (Tn5250Session * This, Tn5250Buffer * buf, if (field->continuous) { - g_free (data); + free (data); } return; } @@ -799,7 +799,7 @@ tn5250_session_write_error_code (Tn5250Session * This) tn5250_display_set_cursor (This->display, tn5250_display_msg_line (This->display), 0); - tempmsg = g_malloc (tn5250_display_width (This->display)); + tempmsg = malloc (tn5250_display_width (This->display)); msglen = 0; while (1) @@ -839,7 +839,7 @@ tn5250_session_write_error_code (Tn5250Session * This) } tn5250_display_set_msg_line (This->display, tempmsg, msglen); - g_free (tempmsg); + free (tempmsg); tn5250_display_set_cursor (This->display, end_y, end_x); @@ -1914,7 +1914,7 @@ tn5250_session_start_of_header (Tn5250Session * This) TN5250_ASSERT ((n > 0 && n <= 7)); if (n > 0) { - ptr = (unsigned char *) g_malloc (n); + ptr = (unsigned char *) malloc (n); } for (i = 0; i < n; i++) { @@ -1923,7 +1923,7 @@ tn5250_session_start_of_header (Tn5250Session * This) tn5250_display_set_header_data (This->display, ptr, n); if (ptr != NULL) { - g_free (ptr); + free (ptr); } return; } @@ -2458,7 +2458,7 @@ tn5250_session_read_screen_immediate (Tn5250Session * This) buffer_size = tn5250_display_width (This->display) * tn5250_display_height (This->display); - buffer = (unsigned char *) g_malloc (buffer_size); + buffer = (unsigned char *) malloc (buffer_size); for (row = 0; row < tn5250_display_height (This->display); row++) { @@ -2475,7 +2475,7 @@ tn5250_session_read_screen_immediate (Tn5250Session * This) tn5250_stream_send_packet (This->stream, buffer_size, header, buffer); - g_free (buffer); + free (buffer); return; } diff --git a/src/sslstream.c b/src/sslstream.c index dccc362..147711c 100644 --- a/src/sslstream.c +++ b/src/sslstream.c @@ -403,7 +403,7 @@ int tn5250_ssl_stream_init (Tn5250Stream *This) if (This->config!=NULL && tn5250_config_get (This->config,"ssl_pem_pass")){ TN5250_LOG(("SSL: Setting password callback\n")); len = strlen(tn5250_config_get (This->config, "ssl_pem_pass")); - This->userdata = g_malloc(len+1); + This->userdata = malloc(len+1); strncpy(This->userdata, tn5250_config_get (This->config, "ssl_pem_pass"), len); SSL_CTX_set_default_passwd_cb(This->ssl_context, @@ -526,7 +526,7 @@ int tn3270_ssl_stream_init (Tn5250Stream *This) if (This->config!=NULL && tn5250_config_get (This->config,"ssl_pem_pass")){ TN5250_LOG(("SSL: Setting password callback\n")); len = strlen(tn5250_config_get (This->config, "ssl_pem_pass")); - This->userdata = g_malloc(len+1); + This->userdata = malloc(len+1); strncpy(This->userdata, tn5250_config_get (This->config, "ssl_pem_pass"), len); SSL_CTX_set_default_passwd_cb(This->ssl_context, @@ -592,7 +592,7 @@ static int ssl_stream_connect(Tn5250Stream * This, const char *to) serv_addr.sin_family = AF_INET; /* Figure out the internet address. */ - address = (char *)g_malloc (strlen (to)+1); + address = (char *)malloc (strlen (to)+1); strcpy (address, to); if (strchr (address, ':')) *strchr (address, ':') = '\0'; @@ -603,7 +603,7 @@ static int ssl_stream_connect(Tn5250Stream * This, const char *to) if (pent != NULL) serv_addr.sin_addr.s_addr = *((u_long *) (pent->h_addr)); } - g_free (address); + free (address); if (serv_addr.sin_addr.s_addr == INADDR_NONE) { TN5250_LOG(("sslstream: Host lookup failed!\n")); return -1; @@ -1275,8 +1275,7 @@ static void ssl_stream_sb(Tn5250Stream * This, unsigned char *sb_buf, int sb_len This->status = This->status | TERMINAL; } else if (sb_buf[0] == NEW_ENVIRON) { - GSList * iter; - Tn5250ConfigStr *data; + Tn5250ConfigStr *iter; tn5250_buffer_append_byte(&out_buf, IAC); tn5250_buffer_append_byte(&out_buf, SB); tn5250_buffer_append_byte(&out_buf, NEW_ENVIRON); @@ -1285,14 +1284,13 @@ static void ssl_stream_sb(Tn5250Stream * This, unsigned char *sb_buf, int sb_len if (This->config != NULL) { if ((iter = This->config->vars) != NULL) { do { - data = (Tn5250ConfigStr *)iter->data; - if (strlen (data->name) > 4 && !memcmp (data->name, "env.", 4)) { + if ((strlen (iter->name) > 4) && (!memcmp (iter->name, "env.", 4))) { ssl_stream_sb_var_value(&out_buf, - (unsigned char *) data->name + 4, - (unsigned char *) data->value); + (unsigned char *) iter->name + 4, + (unsigned char *) iter->value); } - iter = g_slist_next(iter); - } while (iter != NULL); + iter = iter->next; + } while (iter != This->config->vars); } } tn5250_buffer_append_byte(&out_buf, IAC); diff --git a/src/stream.c b/src/stream.c index 6c3115b..25f6329 100644 --- a/src/stream.c +++ b/src/stream.c @@ -163,8 +163,6 @@ Tn5250Stream *tn5250_stream_host (SOCKET_TYPE masterfd, long timeout, int streamtype) { Tn5250Stream *This = tn5250_new(Tn5250Stream, 1); - Tn5250StreamType *iter; - const char *postfix; int ret; if (This != NULL) { @@ -298,11 +296,11 @@ void tn5250_stream_setenv(Tn5250Stream * This, const char *name, const char *val This->config = tn5250_config_new (); TN5250_ASSERT (This->config != NULL); } - name_buf = (char*)g_malloc (strlen (name) + 10); + name_buf = (char*)malloc (strlen (name) + 10); strcpy (name_buf, "env."); strcat (name_buf, name); - tn5250_config_set (This->config, name_buf, CONFIG_STRING, (gpointer)value); - g_free (name_buf); + tn5250_config_set (This->config, name_buf, value); + free (name_buf); } /****f* lib5250/tn5250_stream_getenv @@ -324,11 +322,11 @@ const char *tn5250_stream_getenv(Tn5250Stream * This, const char *name) if (This->config == NULL) return NULL; - name_buf = (char*)g_malloc (strlen (name) + 10); + name_buf = (char*)malloc (strlen (name) + 10); strcpy (name_buf, "env."); strcat (name_buf, name); val = tn5250_config_get (This->config, name_buf); - g_free (name_buf); + free (name_buf); return val; } @@ -349,11 +347,11 @@ void tn5250_stream_unsetenv(Tn5250Stream * This, const char *name) if (This->config == NULL) return; /* Nothing to unset. */ - name_buf = (char*)g_malloc (strlen (name) + 10); + name_buf = (char*)malloc (strlen (name) + 10); strcpy (name_buf, "env."); strcat (name_buf, name); tn5250_config_unset (This->config, name_buf); - g_free (name_buf); + free (name_buf); } int tn5250_stream_socket_handle (Tn5250Stream *This) diff --git a/src/telnetstr.c b/src/telnetstr.c index 8c4e4c9..7652473 100644 --- a/src/telnetstr.c +++ b/src/telnetstr.c @@ -378,7 +378,7 @@ static int telnet_stream_connect(Tn5250Stream * This, const char *to) serv_addr.sin_family = AF_INET; /* Figure out the internet address. */ - address = (char *)g_malloc (strlen (to)+1); + address = (char *)malloc (strlen (to)+1); strcpy (address, to); if (strchr (address, ':')) *strchr (address, ':') = '\0'; @@ -389,7 +389,7 @@ static int telnet_stream_connect(Tn5250Stream * This, const char *to) if (pent != NULL) serv_addr.sin_addr.s_addr = *((u_long *) (pent->h_addr)); } - g_free (address); + free (address); if (serv_addr.sin_addr.s_addr == INADDR_NONE) return LAST_ERROR; @@ -444,11 +444,13 @@ static int telnet_stream_connect(Tn5250Stream * This, const char *to) *****/ static int telnet_stream_accept(Tn5250Stream * This, SOCKET_TYPE masterfd) { - int i, len, retCode; + int i, retCode; + /* + int len; struct sockaddr_in serv_addr; + */ fd_set fdr; struct timeval tv; - int negotiating; #ifndef WINELIB u_long ioctlarg=1L; @@ -619,7 +621,6 @@ static void telnet_stream_destroy(Tn5250Stream *This) *****/ static int telnet_stream_get_next(Tn5250Stream * This, unsigned char *buf, int size) { - unsigned char curchar; int rc; fd_set fdr; struct timeval tv; @@ -975,8 +976,7 @@ static void telnet_stream_sb(Tn5250Stream * This, unsigned char *sb_buf, int sb_ This->status = This->status | TERMINAL; } else if (sb_buf[0] == NEW_ENVIRON) { - GSList * iter; - Tn5250ConfigStr *data; + Tn5250ConfigStr *iter; tn5250_buffer_append_byte(&out_buf, IAC); tn5250_buffer_append_byte(&out_buf, SB); tn5250_buffer_append_byte(&out_buf, NEW_ENVIRON); @@ -985,14 +985,13 @@ static void telnet_stream_sb(Tn5250Stream * This, unsigned char *sb_buf, int sb_ if (This->config != NULL) { if ((iter = This->config->vars) != NULL) { do { - data = (Tn5250ConfigStr *)iter->data; - if (strlen (data->name) > 4 && !memcmp (data->name, "env.", 4)) { - telnet_stream_sb_var_value(&out_buf, - (unsigned char *) data->name + 4, - (unsigned char *) data->value); + if ((strlen (iter->name) > 4) && (!memcmp (iter->name, "env.", 4))) { + telnet_stream_sb_var_value(&out_buf, + (unsigned char *) iter->name + 4, + (unsigned char *) iter->value); } - iter = g_slist_next(iter); - } while (iter != NULL); + iter = iter->next; + } while (iter != This->config->vars); } } tn5250_buffer_append_byte(&out_buf, IAC); diff --git a/src/tn5250-private.h b/src/tn5250-private.h index 8b43dbd..e571b99 100644 --- a/src/tn5250-private.h +++ b/src/tn5250-private.h @@ -36,7 +36,6 @@ #include #include #include -#include #ifdef HAVE_UNISTD_H #include diff --git a/src/utility.c b/src/utility.c index d12f6e6..4a8d006 100644 --- a/src/utility.c +++ b/src/utility.c @@ -47,110 +47,6 @@ void tn5250_closeall(int fd) close(fd++); } -GSList * -build_addr_list(GSList * addrlist) -{ - GSList * iter; - GSList * result; - char * slash; - clientaddr * addr; - struct in_addr tempaddr; - unsigned long int mask; - int rc; - char *tail; - - iter = addrlist; - result = NULL; - - if(iter == NULL) { - addr = g_new(clientaddr, 1); - - rc = inet_aton("127.0.0.1", &tempaddr); - - addr->address = tempaddr.s_addr; - addr->mask = 0xFFFFFFFF; - - result = g_slist_append(result, addr); - } - - while(iter != NULL) - { - slash = strchr(iter->data, '/'); - if(slash == NULL) - goto error_out; - - *slash = '\0'; - - rc = inet_aton(iter->data, &tempaddr); - if(rc == 0) - goto error_out; - - slash++; - - mask = strtol(slash, &tail, 0); - - if(*tail != '\0') - goto error_out; - - mask = 0xFFFFFFFF << 32-mask; - - mask = htonl(mask); - - addr = g_new(clientaddr, 1); - - addr->address = tempaddr.s_addr; - addr->mask = mask; - - result = g_slist_append(result, addr); - - iter = g_slist_next(iter); - } - - return(result); - - error_out: - return(NULL); -} - -int -valid_client(GSList * addrlist, unsigned long int client) -{ - GSList * iter; - unsigned long int config; - unsigned long int mask; - clientaddr * data; - - iter = addrlist; - - while(iter != NULL) - { - data = (clientaddr *)iter->data; - config = data->address; - mask = data->mask; - - if( (config & mask) == (client & mask) ) - return(1); - - iter = g_slist_next(iter); - } - - return(0); -} - -void destroy_addr_list(GSList * addrlist) -{ - GSList * iter; - - iter = addrlist; - - while(iter != NULL) - { - g_free(iter->data); - iter = g_slist_next(iter); - } - g_slist_free(iter); -} - /* Signal handler for SIGCHLD. We use waitpid instead of wait, since there is no way to tell wait not to block if there are still non-terminated child diff --git a/src/utility.h b/src/utility.h index 8c507ce..2048782 100644 --- a/src/utility.h +++ b/src/utility.h @@ -58,7 +58,6 @@ typedef unsigned char Tn5250Char; * SOURCE */ -#include struct _Tn5250CharMap { const char *name; @@ -84,9 +83,6 @@ void tn5250_char_map_destroy(Tn5250CharMap *This); void tn5250_closeall(int fd); int tn5250_daemon(int nochdir, int noclose, int ignsigcld); int tn5250_make_socket(unsigned short int port); -GSList * build_addr_list(GSList * addrlist); -int valid_client(GSList * addrlist, unsigned long int client); -void destroy_addr_list(GSList * addrlist); Tn5250Char tn5250_char_map_to_remote(Tn5250CharMap *This, Tn5250Char ascii); Tn5250Char tn5250_char_map_to_local(Tn5250CharMap *This, Tn5250Char ebcdic); diff --git a/src/wtd.c b/src/wtd.c index c010773..f9923c4 100644 --- a/src/wtd.c +++ b/src/wtd.c @@ -92,7 +92,7 @@ void tn5250_wtd_context_destroy (Tn5250WTDContext * This) { TN5250_ASSERT (This != NULL); - g_free (This); + free (This); return; } diff --git a/tn5250-config.in b/tn5250-config.in index 2c3c231..b0fbbee 100755 --- a/tn5250-config.in +++ b/tn5250-config.in @@ -21,8 +21,6 @@ includedir="@includedir@" oldincludedir="@oldincludedir@" LIBS="@LIBS@" VERSION="@VERSION@" -GLIB_LIBS="@GLIB_LIBS@" -GLIB_CFLAGS="@GLIB_CFLAGS@" syntax () { cat <