*** bash-2.05a/variables.c.orig Mon Nov 5 23:55:34 2001 --- bash-2.05a/variables.c Tue Feb 12 17:51:12 2002 *************** *** 18,23 **** --- 18,34 ---- along with Bash; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + /*====================================================================== + * This file was modified by SAKAIDA Masaaki. + * + * Change Logs + * 1. Add the exec_sql_init() call. + * 2. Add bind_xxx_variable() wrap routine. + * + *====================================================================== + */ + + #include "config.h" #include "bashtypes.h" *************** *** 312,317 **** --- 323,333 ---- } set_if_not ("PS4", "+ "); + /*============================================== + * Initialize exec_sql function for PostgreSQL + *=============================================*/ + exec_sql_init(interactive_shell); + /* Don't allow IFS to be imported from the environment. */ temp_var = bind_variable ("IFS", " \t\n"); *************** *** 3293,3295 **** --- 3309,3371 ---- set_pipestatus_array (v); #endif } + + + /* + * ################################################################### + * bash shell bind_variable() wrap routine. + * ################################################################## + */ + + int + wrap_bind_int_variable(char *name, int value) + /******************************************************************* + * bind integer variable to shell variable + *******************************************************************/ + { + SHELL_VAR *var; + char buf[32]; + + sprintf(buf, "%d", value); + + if ((var = bind_variable(name, buf)) == NULL) + return (-1); + + var->attributes = att_integer; + + return (0); + } + + int + wrap_bind_char_variable(char *name, char *value) + /******************************************************************* + * bind_variable wrapper routine. + *******************************************************************/ + { + SHELL_VAR *var; + + if ((var = bind_variable(name, value)) == NULL) + return (-1); + + return (0); + } + + + int + wrap_find_variable(char *name, char *value) + /******************************************************************* + * find_variable wrapper routine. + *******************************************************************/ + { + SHELL_VAR *var; + + value[0] = '\0'; + + if ((var = find_variable(name)) != NULL ) + strcpy(value, var->value); + else + return(-1); + + return(0); + } +