diff -Nur bash-3.0/Makefile.in bash-3.0-sql-1.0.0/Makefile.in --- bash-3.0/Makefile.in 2004-03-17 14:34:39.000000000 +0100 +++ bash-3.0-sql-1.0.0/Makefile.in 2006-04-11 18:35:49.000000000 +0200 @@ -67,6 +67,7 @@ AR = @AR@ ARFLAGS = @ARFLAGS@ RANLIB = @RANLIB@ +STRIP=strip INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -117,7 +118,7 @@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ -CPPFLAGS = @CPPFLAGS@ +CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG} DEFS = @DEFS@ @@ -483,6 +484,9 @@ PO_SRC = $(srcdir)/po/ PO_DIR = $(dot)/po/ +# intergenia AG loadable extensions. +IG_LOADABLES_SRC = $(srcdir)/intergenia/loadables + SIGNAMES_SUPPORT = $(SUPPORT_SRC)mksignames.c SUPPORT_SRC = $(srcdir)/support/ @@ -512,8 +516,8 @@ $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) $(RM) $@ $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) + @(cd $(IG_LOADABLES_SRC) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG}) || exit 1 ls -l $(Program) - size $(Program) .build: $(SOURCES) config.h Makefile version.h $(VERSPROG) @echo @@ -533,9 +537,8 @@ @chmod a+rx bashbug strip: $(Program) .made - strip $(Program) + $(STRIP) $(Program) ls -l $(Program) - size $(Program) lint: ${MAKE} ${MFLAGS} CFLAGS='${GCC_LINT_FLAGS}' .made @@ -706,6 +709,7 @@ man3dir=$(man3dir) man3ext=$(man3ext) \ infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ ) -( cd $(DEFDIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + -( cd $(IG_LOADABLES_SRC) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) install-strip: @@ -719,6 +723,7 @@ man1dir=$(man1dir) man1ext=$(man1ext) \ man3dir=$(man3dir) man3ext=$(man3ext) \ infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ ) + -( cd $(IG_LOADABLES_SRC) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) .PHONY: basic-clean clean realclean maintainer-clean distclean mostlyclean maybe-clean @@ -737,6 +742,7 @@ -for libdir in ${LIB_SUBDIRS}; do \ (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ done + -( cd $(IG_LOADABLES_SRC) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) $(RM) $(CREATED_SUPPORT) @@ -747,6 +753,7 @@ -for libdir in ${LIB_SUBDIRS}; do \ (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ done + -( cd $(IG_LOADABLES_SRC) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) distclean: basic-clean maybe-clean @@ -756,6 +763,7 @@ -for libdir in ${LIB_SUBDIRS}; do \ (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ done + -( cd $(IG_LOADABLES_SRC) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) $(RM) $(CREATED_CONFIGURE) tags TAGS $(RM) $(CREATED_SUPPORT) Makefile $(CREATED_MAKEFILES) @@ -770,6 +778,7 @@ -for libdir in ${LIB_SUBDIRS}; do \ (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ done + -( cd $(IG_LOADABLES_SRC) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) $(RM) $(CREATED_CONFIGURE) $(CREATED_MAKEFILES) $(RM) $(CREATED_SUPPORT) Makefile diff -Nur bash-3.0/array.c bash-3.0-sql-1.0.0/array.c --- bash-3.0/array.c 2004-05-06 14:24:13.000000000 +0200 +++ bash-3.0-sql-1.0.0/array.c 2006-04-11 18:35:49.000000000 +0200 @@ -791,7 +791,7 @@ } GENERIC_LIST * -list_reverse (list) +bash_list_reverse (list) GENERIC_LIST *list; { register GENERIC_LIST *next, *prev; diff -Nur bash-3.0/config.h.in bash-3.0-sql-1.0.0/config.h.in --- bash-3.0/config.h.in 2004-07-21 22:08:31.000000000 +0200 +++ bash-3.0-sql-1.0.0/config.h.in 2006-04-11 18:35:49.000000000 +0200 @@ -158,6 +158,9 @@ #include "config-top.h" +/* Define HAVE_MYSQL if you want the bash to use a native MySQL backend. */ +#undef HAVE_MYSQL + /* Beginning of autoconf additions. */ /* Characteristics of the C compiler */ diff -Nur bash-3.0/configure.in bash-3.0-sql-1.0.0/configure.in --- bash-3.0/configure.in 2004-07-21 22:06:54.000000000 +0200 +++ bash-3.0-sql-1.0.0/configure.in 2006-04-11 18:35:27.000000000 +0200 @@ -181,6 +181,7 @@ opt_separate_help=no opt_multibyte=yes opt_debugger=yes +opt_builtin_mysql=no dnl options that affect how bash is compiled and linked opt_static_link=no @@ -199,7 +200,7 @@ opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no opt_net_redirs=no opt_progcomp=no opt_separate_help=no - opt_multibyte=yes opt_cond_regexp=no + opt_multibyte=yes opt_cond_regexp=no opt_builtin_mysql=no fi AC_ARG_ENABLE(alias, AC_HELP_STRING([--enable-alias], [enable shell aliases]), opt_alias=$enableval) @@ -229,6 +230,7 @@ AC_ARG_ENABLE(separate-helpfiles, AC_HELP_STRING([--enable-separate-helpfiles], [use external files for help builtin documentation]), opt_separate_help=$enableval) AC_ARG_ENABLE(usg-echo-default, AC_HELP_STRING([--enable-usg-echo-default], [a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval) AC_ARG_ENABLE(xpg-echo-default, AC_HELP_STRING([--enable-xpg-echo-default], [make the echo builtin expand escape sequences by default]), opt_xpg_echo=$enableval) +AC_ARG_ENABLE(builtin-mysql, AC_HELP_STRING([--enable-builtin-mysql], [include builtin to native MySQL interface]), opt_builtin_mysql=$enableval) dnl options that alter how bash is compiled and linked AC_ARG_ENABLE(mem-scramble, AC_HELP_STRING([--enable-mem-scramble], [scramble memory on calls to malloc and free]), opt_memscramble=$enableval) @@ -579,6 +581,23 @@ sys/time.h sys/times.h sys/types.h sys/wait.h) AC_CHECK_HEADERS(netinet/in.h arpa/inet.h) +dnl Check for mysql.h (MySQL). If it's not picked up automatically, then +dnl try something like +dnl (cd /usr/local/include; ln -s ../mysql/include mysql) +dnl (cd /usr/local/lib; ln -s ../mysql/lib mysql) +if test $opt_builtin_mysql = yes; then + AC_CHECK_HEADER(mysql/mysql.h) + if test "$ac_cv_header_mysql_mysql_h" = yes; then + AC_DEFINE(HAVE_MYSQL) + MYSQL_LIB=-lmysqlclient + if test -d /usr/local/lib/mysql; then + MYSQL_LDFLAGS=-L/usr/local/lib/mysql + fi + AC_SUBST(MYSQL_LIB) + AC_SUBST(MYSQL_LDFLAGS) + fi +fi + dnl special checks for libc functions AC_FUNC_ALLOCA AC_FUNC_GETPGRP @@ -1019,7 +1038,7 @@ lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \ lib/tilde/Makefile doc/Makefile support/Makefile po/Makefile.in \ examples/loadables/Makefile examples/loadables/perl/Makefile \ - pathnames.h], + pathnames.h intergenia/loadables/Makefile], [ # Makefile uses this timestamp file to record whether config.h is up to date. echo timestamp > stamp-h diff -Nur bash-3.0/examples/loadables/getconf.c bash-3.0-sql-1.0.0/examples/loadables/getconf.c --- bash-3.0/examples/loadables/getconf.c 2002-09-20 21:49:27.000000000 +0200 +++ bash-3.0-sql-1.0.0/examples/loadables/getconf.c 2006-04-11 18:35:49.000000000 +0200 @@ -1155,7 +1155,7 @@ } list = loptend; - if ((aflag == 0 && list == 0) || (aflag && list) || list_length(list) > 2) { + if ((aflag == 0 && list == 0) || (aflag && list) || bash_list_length(list) > 2) { builtin_usage(); return(EX_USAGE); } diff -Nur bash-3.0/execute_cmd.c bash-3.0-sql-1.0.0/execute_cmd.c --- bash-3.0/execute_cmd.c 2004-07-04 20:12:58.000000000 +0200 +++ bash-3.0-sql-1.0.0/execute_cmd.c 2006-04-11 18:35:49.000000000 +0200 @@ -2056,7 +2056,7 @@ /* command and arithmetic substitution, parameter and variable expansion, word splitting, pathname expansion, and quote removal. */ list = releaser = expand_words_no_vars (select_command->map_list); - list_len = list_length (list); + list_len = bash_list_length (list); if (list == 0 || list_len == 0) { if (list) diff -Nur bash-3.0/externs.h bash-3.0-sql-1.0.0/externs.h --- bash-3.0/externs.h 2004-04-13 05:30:08.000000000 +0200 +++ bash-3.0-sql-1.0.0/externs.h 2006-04-11 18:35:49.000000000 +0200 @@ -118,12 +118,12 @@ extern char *localeexpand __P((char *, int, int, int, int *)); /* Declarations for functions defined in list.c. */ -extern void list_walk __P((GENERIC_LIST *, sh_glist_func_t *)); -extern void wlist_walk __P((WORD_LIST *, sh_icpfunc_t *)); -extern GENERIC_LIST *list_reverse (); -extern int list_length (); -extern GENERIC_LIST *list_append (); -extern GENERIC_LIST *list_remove (); +extern void bash_list_walk __P((GENERIC_LIST *, sh_glist_func_t *)); +extern void bash_wlist_walk __P((WORD_LIST *, sh_icpfunc_t *)); +extern GENERIC_LIST *bash_list_reverse (); +extern int bash_list_length (); +extern GENERIC_LIST *bash_list_append (); +extern GENERIC_LIST *bash_list_remove (); /* Declarations for functions defined in stringlib.c */ extern int find_string_in_alist __P((char *, STRING_INT_ALIST *, int)); diff -Nur bash-3.0/general.h bash-3.0-sql-1.0.0/general.h --- bash-3.0/general.h 2004-04-15 01:44:58.000000000 +0200 +++ bash-3.0-sql-1.0.0/general.h 2006-04-11 18:35:49.000000000 +0200 @@ -125,7 +125,7 @@ /* A macro to avoid making an uneccessary function call. */ #define REVERSE_LIST(list, type) \ - ((list && list->next) ? (type)list_reverse ((GENERIC_LIST *)list) \ + ((list && list->next) ? (type)bash_list_reverse ((GENERIC_LIST *)list) \ : (type)(list)) #if __GNUC__ > 1 diff -Nur bash-3.0/intergenia/loadables/Makefile.in bash-3.0-sql-1.0.0/intergenia/loadables/Makefile.in --- bash-3.0/intergenia/loadables/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ bash-3.0-sql-1.0.0/intergenia/loadables/Makefile.in 2006-04-11 18:35:49.000000000 +0200 @@ -0,0 +1,116 @@ +# +# Simple makefile for the sample loadable builtins +# +# Copyright (C) 1996 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + +# Include some boilerplate Gnu makefile definitions. +prefix = @prefix@ + +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +infodir = @infodir@ +includedir = @includedir@ + +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ +srcdir = @srcdir@ +VPATH = .:@srcdir@ + +@SET_MAKE@ +CC = @CC@ +RM = rm -f + +SHELL = @MAKE_SHELL@ + +host_os = @host_os@ +host_cpu = @host_cpu@ +host_vendor = @host_vendor@ + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS) + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALLMODE= -m 0644 + +# +# These values are generated for configure by ${topdir}/support/shobj-conf. +# If your system is not supported by that script, but includes facilities for +# dynamic loading of shared objects, please update the script and send the +# changes to bash-maintainers@gnu.org. +# +SHOBJ_CC = @SHOBJ_CC@ +SHOBJ_CFLAGS = @SHOBJ_CFLAGS@ +SHOBJ_LD = @SHOBJ_LD@ +SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ +SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ +SHOBJ_LIBS = @SHOBJ_LIBS@ +SHOBJ_STATUS = @SHOBJ_STATUS@ +MYSQL_LIB = @MYSQL_LIB@ +MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ + +INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ + -I$(topdir)/include -I$(BUILD_DIR) -I$(BUILD_DIR)/lib \ + -I$(BUILD_DIR)/builtins + +.c.o: + $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< + + +ALLPROG = mysql + +all: $(SHOBJ_STATUS) + +supported: $(ALLPROG) + +unsupported: + @echo "Your system (${host_os}) is not supported by the" + @echo "${topdir}/support/shobj-conf script." + @echo "If your operating system provides facilities for dynamic" + @echo "loading of shared objects using the dlopen(3) interface," + @echo "please update the script and re-run configure. + @echo "Please send the changes you made to bash-maintainers@gnu.org" + @echo "for inclusion in future bash releases." + +everything: supported others + +mysql: mysql.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) $(MYSQL_LDFLAGS) -o $@ mysql.o $(SHOBJ_LIBS) $(MYSQL_LIB) + +clean: + $(RM) $(ALLPROG) *.o + +mostlyclean: clean + +distclean maintainer-clean: clean + $(RM) Makefile + +mysql.o: mysql.c + +install: + mkdir -p $(DESTDIR)$(libdir)/bash + $(INSTALL_PROGRAM) $(INSTALLMODE) mysql $(DESTDIR)$(libdir)/bash/mysql + +uninstall: + rm -f $(DESTDIR)$(libdir)/bash/mysql diff -Nur bash-3.0/intergenia/loadables/mysql.c bash-3.0-sql-1.0.0/intergenia/loadables/mysql.c --- bash-3.0/intergenia/loadables/mysql.c 1970-01-01 01:00:00.000000000 +0100 +++ bash-3.0-sql-1.0.0/intergenia/loadables/mysql.c 2006-04-11 18:35:49.000000000 +0200 @@ -0,0 +1,204 @@ +/* + * mysql.c -- native mysql query engine for bash. + * + * Copyright (C) 2006 Maik Broemme + * + * Differences between BashDiff and Bash-SQL: + * + * - working with MySQL 3/4/5. + * - working multirow queries and results support. + * + * This source was adepted from the BashDiff project. The BashDiff + * project belongs to the following authors: + * + * William Park + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include /* puts(), printf(), BUFSIZE, ... */ + +#include "shell.h" /* includes lots of headers */ +#include "bashansi.h" /* string.h, strings.h, stdlib.h */ +#include "common.h" /* builtin_error(), ... */ +#include "bashgetopt.h" /* internal_getopt(), ... */ +#include "builtins.h" /* xxx_doc[], builtin xxx_struct */ + +#if defined (HAVE_MYSQL) +#include + +int +mysql_builtin (list) + WORD_LIST *list; +{ + int opt, out, i, j; + SHELL_VAR *var; + char *host, *port, *dbname, *user, *password, *text, *t; + + MYSQL mysql; + MYSQL_RES *result; + my_ulonglong MYSQL_ROWS; + unsigned int MYSQL_COLUMS; + MYSQL_ROW row; + unsigned long *length; + + var = (SHELL_VAR *)NULL; + host = port = dbname = user = password = (char *)NULL; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "a:h:P:d:u:p:")) != -1) { + switch (opt) { + case 'h': + host = list_optarg; + break; + case 'P': + port = list_optarg; + break; + case 'd': + dbname = list_optarg; + break; + case 'u': + user = list_optarg; + break; + case 'p': + password = list_optarg; + break; + default: + builtin_usage (); + return (EX_BADUSAGE); + } + } + + /* skip over possible `--' */ + list = loptend; + + /* 0 argument */ + if (list == 0) { + builtin_usage (); + return (EX_BADUSAGE); + } + + unbind_variable ("MYSQL_COLUMS"); + unbind_variable ("MYSQL_ROWS"); + + /* 1 or more arguments: mysql [-option] SQL... */ + + if (mysql_init (&mysql) == 0) { + builtin_error ("cannot initialize"); + return (EXECUTION_FAILURE); + } + + if (mysql_real_connect ( + &mysql, + host, + user, + password, + dbname, /* NULL means default value */ + (unsigned int)atoi (port? port: "0"), /* 0 means default port */ + (char *)NULL, /* unix socket */ + (unsigned long)0 /* client flag */ + ) == 0) { + builtin_error ("cannot connect to server: %s", mysql_error(&mysql)); + mysql_close (&mysql); + return (EXECUTION_FAILURE); + } + + out = EXECUTION_SUCCESS; + for ( ; list && out == EXECUTION_SUCCESS; list = list->next) { + text = list->word->word; + + /* check if query execution was ok */ + if (mysql_query (&mysql, text)) { + out = EXECUTION_FAILURE; + builtin_error ("query failed: %s", mysql_error(&mysql)); + } else if (result = mysql_store_result (&mysql)) { + + /* fill variables with mysql values */ + MYSQL_ROWS = mysql_num_rows (result); + MYSQL_COLUMS = mysql_num_fields (result); + + /* export variables to environment */ + bind_var_to_int ("MYSQL_ROWS", MYSQL_ROWS); + bind_var_to_int ("MYSQL_COLUMS", MYSQL_COLUMS); + + while (row = mysql_fetch_row (result)) { + for (j = 0; j < MYSQL_COLUMS; j++) { + printf ("%s", row[j]); + putchar ((j < MYSQL_COLUMS-1) ? '\t' : '\n'); + } + } + mysql_free_result (result); + } else if (mysql_field_count (&mysql)) { + out = EXECUTION_FAILURE; + builtin_error ("result failed: %s", mysql_error(&mysql)); + } + } + + mysql_close (&mysql); + return (out); +} + +#else /* HAVE_MYSQL */ +int +mysql_builtin (list) + WORD_LIST *list; +{ + + /* 0 argument */ + builtin_usage (); + return (EX_BADUSAGE); +} +#endif /* HAVE_MYSQL */ + +char *mysql_doc[] = { + "Interface to MySQL 3/4/5 (www.mysql.com). After connecting to database,", + "arguments are feed to SQL engine sequentially. It returns 1 immediately on", + "any error. If all arguments are processed without error, then returns", + "success (0). Each 'mysql' command is complete, in that it opens and closes", + "connection with the database.", + "", + " mysql [-hpduP ...] SQL...", + " Print query result (if any) to stdout. Fields are separated by \\t,", + " one row per line.", + "", + "Options -[hpduP] are optional. Default value will be used for missing", + "parameters. For convenience, shell variables MYSQL_COLUMS and MYSQL_ROWS", + "are set from the last query result.", + (char *)NULL +}; + +#if defined (HAVE_MYSQL) +struct builtin mysql_struct = { + "mysql", mysql_builtin, BUILTIN_ENABLED, mysql_doc, + "mysql [-h host -P port -d dbname -u user -p password ] SQL...", + (char *)NULL +}; + +#else /* HAVE_MYSQL */ +struct builtin mysql_struct = { + "mysql", mysql_builtin, BUILTIN_ENABLED, mysql_doc, + "mysql-support disabled at compilation time, enable it with '--enable-builtin-mysql'", + (char *)NULL +}; +#endif /* HAVE_MYSQL */ diff -Nur bash-3.0/lib/sh/stringlist.c bash-3.0-sql-1.0.0/lib/sh/stringlist.c --- bash-3.0/lib/sh/stringlist.c 2002-03-25 19:03:32.000000000 +0100 +++ bash-3.0-sql-1.0.0/lib/sh/stringlist.c 2006-04-11 18:35:49.000000000 +0200 @@ -272,7 +272,7 @@ *ip = 0; return ((STRINGLIST *)0); } - slen = list_length (list); + slen = bash_list_length (list); ret = (STRINGLIST *)xmalloc (sizeof (STRINGLIST)); ret->list = strvec_from_word_list (list, alloc, starting_index, &len); ret->list_size = slen + starting_index; diff -Nur bash-3.0/lib/sh/stringvec.c bash-3.0-sql-1.0.0/lib/sh/stringvec.c --- bash-3.0/lib/sh/stringvec.c 2002-03-25 19:00:46.000000000 +0100 +++ bash-3.0-sql-1.0.0/lib/sh/stringvec.c 2006-04-11 18:35:49.000000000 +0200 @@ -184,7 +184,7 @@ int count; char **array; - count = list_length (list); + count = bash_list_length (list); array = (char **)xmalloc ((1 + count + starting_index) * sizeof (char *)); for (count = 0; count < starting_index; count++) diff -Nur bash-3.0/list.c bash-3.0-sql-1.0.0/list.c --- bash-3.0/list.c 2002-03-18 19:13:54.000000000 +0100 +++ bash-3.0-sql-1.0.0/list.c 2006-04-11 18:35:49.000000000 +0200 @@ -36,7 +36,7 @@ #ifdef INCLUDE_UNUSED /* Call FUNCTION on every member of LIST, a generic list. */ void -list_walk (list, function) +bash_list_walk (list, function) GENERIC_LIST *list; sh_glist_func_t *function; { @@ -47,7 +47,7 @@ /* Call FUNCTION on every string in WORDS. */ void -wlist_walk (words, function) +bash_wlist_walk (words, function) WORD_LIST *words; sh_icpfunc_t *function; { @@ -61,7 +61,7 @@ of the chain. You should always assign the output value of this function to something, or you will lose the chain. */ GENERIC_LIST * -list_reverse (list) +bash_list_reverse (list) GENERIC_LIST *list; { register GENERIC_LIST *next, *prev; @@ -78,7 +78,7 @@ /* Return the number of elements in LIST, a generic list. */ int -list_length (list) +bash_list_length (list) GENERIC_LIST *list; { register int i; @@ -89,7 +89,7 @@ /* Append TAIL to HEAD. Return the header of the list. */ GENERIC_LIST * -list_append (head, tail) +bash_list_append (head, tail) GENERIC_LIST *head, *tail; { register GENERIC_LIST *t_head; @@ -110,11 +110,11 @@ then ARG. Note that LIST contains the address of a variable which points to the list. You might call this function like this: - SHELL_VAR *elt = list_remove (&variable_list, check_var_has_name, "foo"); + SHELL_VAR *elt = bash_list_remove (&variable_list, check_var_has_name, "foo"); dispose_variable (elt); */ GENERIC_LIST * -list_remove (list, comparer, arg) +bash_list_remove (list, comparer, arg) GENERIC_LIST **list; Function *comparer; char *arg; diff -Nur bash-3.0/pcomplete.c bash-3.0-sql-1.0.0/pcomplete.c --- bash-3.0/pcomplete.c 2004-01-08 16:36:17.000000000 +0100 +++ bash-3.0-sql-1.0.0/pcomplete.c 2006-04-11 18:35:49.000000000 +0200 @@ -830,7 +830,7 @@ l2 = expand_words_shellexp (l); dispose_words (l); - nw = list_length (l2); + nw = bash_list_length (l2); sl = strlist_create (nw + 1); ntxt = bash_dequote_text (text); diff -Nur bash-3.0/subst.c bash-3.0-sql-1.0.0/subst.c --- bash-3.0/subst.c 2004-07-04 19:56:13.000000000 +0200 +++ bash-3.0-sql-1.0.0/subst.c 2006-04-11 18:35:49.000000000 +0200 @@ -6766,7 +6766,7 @@ for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) { tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); - result = (WORD_LIST *) list_append (result, tresult); + result = (WORD_LIST *) bash_list_append (result, tresult); } return (result); } @@ -6839,7 +6839,7 @@ for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) { tresult = word_split (t->word, ifs_value); - result = (WORD_LIST *) list_append (result, tresult); + result = (WORD_LIST *) bash_list_append (result, tresult); } return (result); } @@ -7070,7 +7070,7 @@ if (glob_list) { - output_list = (WORD_LIST *)list_append (glob_list, output_list); + output_list = (WORD_LIST *)bash_list_append (glob_list, output_list); PREPEND_LIST (tlist, disposables); } else if (fail_glob_expansion != 0) @@ -7250,7 +7250,7 @@ } expanded = REVERSE_LIST (temp_list, WORD_LIST *); - new_list = (WORD_LIST *)list_append (expanded, new_list); + new_list = (WORD_LIST *)bash_list_append (expanded, new_list); } if (orig_list) @@ -7379,7 +7379,7 @@ } #if 0 - tint = list_length (new_list) + 1; + tint = bash_list_length (new_list) + 1; RESIZE_MALLOCED_BUFFER (glob_argv_flags, 0, tint, glob_argv_flags_size, 16); for (tint = 0, temp_list = new_list; temp_list; temp_list = temp_list->next) glob_argv_flags[tint++] = (temp_list->word->flags & W_GLOBEXP) ? '1' : '0';